Package io.crate.planner.symbol

Examples of io.crate.planner.symbol.Symbol$SymbolFactory


        assertLiteralSymbol(symbol, false);
    }

    @Test
    public void testTrueAndMatchFunction() throws Exception {
        Symbol symbol = convert(fromSQL("true and match (table_name, 'jalla')"));
        assertLiteralSymbol(symbol, true);
    }
View Full Code Here


        assertLiteralSymbol(symbol, true);
    }

    @Test
    public void testComplexNestedDifferentMethods() throws Exception {
        Symbol symbol = convert(fromSQL(
            "number_of_shards = 1 or (number_of_replicas = 3 and schema_name = 'sys') " +
                "or not (number_of_shards = 2) and substr(table_name, 1, 1) = '1'"));
        assertLiteralSymbol(symbol, true);
    }
View Full Code Here

        assertLiteralSymbol(symbol, true);
    }

    @Test
    public void testIsNull() throws Exception {
        Symbol symbol = convert(fromSQL("clustered_by is null"));
        assertLiteralSymbol(symbol, true);
    }
View Full Code Here

        assertLiteralSymbol(symbol, true);
    }

    @Test
    public void testNot_NullAndSubstr() throws Exception {
        Symbol symbol = convert(fromSQL("not (null and substr(table_name, 1, 1) = '1')"));
        assertLiteralSymbol(symbol, null, DataTypes.BOOLEAN);
    }
View Full Code Here

        assertLiteralSymbol(symbol, null, DataTypes.BOOLEAN);
    }

    @Test
    public void testNot_FalseAndSubstr() throws Exception {
        Symbol symbol = convert(fromSQL("not (false and substr(table_name, 1, 1) = '1')"));
        assertLiteralSymbol(symbol, true);
    }
View Full Code Here

        assertLiteralSymbol(symbol, true);
    }

    @Test
    public void testNotPredicate() throws Exception {
        Symbol symbol = convert(fromSQL(("not (clustered_by = 'foo')")));
        assertLiteralSymbol(symbol, true);
    }
View Full Code Here

        assertLiteralSymbol(symbol, true);
    }

    @Test
    public void testComplexNestedDifferentMethodsEvaluatesToFalse() throws Exception {
        Symbol symbol = convert(fromSQL(
            "(number_of_shards = 1 or number_of_replicas = 3 and schema_name = 'sys' " +
                "or not (number_of_shards = 2)) and substr(table_name, 1, 1) = '1' and false"));
        assertLiteralSymbol(symbol, false);
    }
View Full Code Here

        assertLiteralSymbol(symbol, false);
    }

    @Test
    public void testNullAndMatchFunction() throws Exception {
        Symbol symbol = convert(fromSQL("null and match (table_name, 'jalla')"));
        assertLiteralSymbol(symbol, null, DataTypes.BOOLEAN);
    }
View Full Code Here

    @Test
    public void testNormalizeSymbolReferenceTimestamp() throws Exception {
        Function function = new Function(func.info(),
                Arrays.<Symbol>asList(Literal.newLiteral("day"), new Reference(new ReferenceInfo(null,null, DataTypes.TIMESTAMP))));
        Symbol result = func.normalizeSymbol(function);
        assertSame(function, result);
    }
View Full Code Here

        assertSame(function, result);
    }

    @Test
    public void testNormalizeSymbolTimestampLiteral() throws Exception {
        Symbol result = normalize(
                Literal.newLiteral("day"),
                Literal.newLiteral(DataTypes.TIMESTAMP, DataTypes.TIMESTAMP.value("2014-02-25T13:38:01.123")));
        assertLiteralSymbol(result, 1393286400000L, DataTypes.TIMESTAMP);
    }
View Full Code Here

TOP

Related Classes of io.crate.planner.symbol.Symbol$SymbolFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.