Package io.crate.planner.symbol

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


                termIndex
        );
        Function function = createFunction(SubscriptFunction.NAME, DataTypes.STRING, arguments);
        SubscriptFunction subscriptFunction = (SubscriptFunction) functions.get(function.info().ident());

        Symbol result = subscriptFunction.normalizeSymbol(function);
        assertLiteralSymbol(result, expected.utf8ToString());

        arguments = Arrays.<Symbol>asList(
                createReference("text", term.valueType()),
                termIndex
View Full Code Here


                Literal.newLiteral(3)
        );
        Function function = createFunction(SubscriptFunction.NAME, DataTypes.STRING, arguments);
        SubscriptFunction subscriptFunction = (SubscriptFunction) functions.get(function.info().ident());

        Symbol result = subscriptFunction.normalizeSymbol(function);
        assertThat(result, isLiteral(null, DataTypes.STRING));
    }
View Full Code Here

    public void testNormalizeSymbol() {
        EqOperator op = getOp(DataTypes.INTEGER);

        Function function = new Function(
                op.info(), Arrays.<Symbol>asList(Literal.newLiteral(2), Literal.newLiteral(2)));
        Symbol result = op.normalizeSymbol(function);

        assertLiteralSymbol(result, true);
    }
View Full Code Here

    public void testNormalizeSymbolNeq() {
        EqOperator op = getOp(DataTypes.INTEGER);

        Function function = new Function(
                op.info(), Arrays.<Symbol>asList(Literal.newLiteral(2), Literal.newLiteral(4)));
        Symbol result = op.normalizeSymbol(function);

        assertLiteralSymbol(result, false);
    }
View Full Code Here

        assertThat(f1.equals(f2), is(true)); // symbols are equal

        // EqOperator doesn't know (yet) if the result of the functions will be equal so no normalization
        Function function = new Function(op.info(), Arrays.<Symbol>asList(f1, f2));
        Symbol result = op.normalizeSymbol(function);

        assertThat(result, instanceOf(Function.class));
    }
View Full Code Here

                ),
                Arrays.<Symbol>asList(name_ref, Literal.newLiteral("foo"))
        );

        Function not = new Function(notPredicate.info(), Arrays.<Symbol>asList(eqName));
        Symbol normalized = notPredicate.normalizeSymbol(not);

        assertThat(normalized, instanceOf(Function.class));
    }
View Full Code Here

    @Test
    public void testNormalizeBooleanTrueAndNonLiteral() throws Exception {
        AndOperator operator = new AndOperator();
        Function function = new Function(
                operator.info(), Arrays.<Symbol>asList(Literal.newLiteral(true), new Reference()));
        Symbol symbol = operator.normalizeSymbol(function);
        assertThat(symbol, instanceOf(Reference.class));
    }
View Full Code Here

    @Test
    public void testNormalizeBooleanFalseAndNonLiteral() throws Exception {
        AndOperator operator = new AndOperator();
        Function function = new Function(
                operator.info(), Arrays.<Symbol>asList(Literal.newLiteral(false), new Reference()));
        Symbol symbol = operator.normalizeSymbol(function);

        assertLiteralSymbol(symbol, false);
    }
View Full Code Here

    @Test
    public void testNormalizeLiteralAndLiteral() throws Exception {
        AndOperator operator = new AndOperator();
        Function function = new Function(
                operator.info(), Arrays.<Symbol>asList(Literal.newLiteral(true), Literal.newLiteral(true)));
        Symbol symbol = operator.normalizeSymbol(function);
        assertLiteralSymbol(symbol, true);
    }
View Full Code Here

    @Test
    public void testNormalizeLiteralAndLiteralFalse() throws Exception {
        AndOperator operator = new AndOperator();
        Function function = new Function(
                operator.info(), Arrays.<Symbol>asList(Literal.newLiteral(true), Literal.newLiteral(false)));
        Symbol symbol = operator.normalizeSymbol(function);
        assertLiteralSymbol(symbol, false);
    }
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.