Package io.crate.planner.symbol

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


    @Override
    public Symbol normalizeSymbol(Function function) {
        // ... where id in (1,2,3,4,...)
        // arguments.get(0) ... id
        // arguments.get(1) ... SetLiteral<Literal> (1,2,3,4,...)
        Symbol left = function.arguments().get(0);
        if (!left.symbolType().isValueSymbol()) {
            return function;
        }
        Object inValue = ((Literal) left).value();
        Literal inList = (Literal) function.arguments().get(1);
        assert inList.valueType().id() == SetType.ID;
View Full Code Here


    @Override
    public Symbol normalizeSymbol(Function function) {
        assert (function != null);
        assert function.arguments().size() == 2;

        Symbol left = function.arguments().get(0);
        Symbol right = function.arguments().get(1);

        if (left instanceof Input && right instanceof Input) {
            return Literal.newLiteral(evaluate((Input) left, (Input) right));
        }
View Full Code Here

    @Override
    public Symbol normalizeSymbol(Function symbol) {
        assert (symbol != null);
        assert symbol.arguments().size() == 2;

        Symbol sourceSymbol = symbol.arguments().get(0);
        Symbol patternSymbol = symbol.arguments().get(1);

        if (containsNull(sourceSymbol, patternSymbol)) {
            return Literal.NULL;
        }
        if (!sourceSymbol.symbolType().isValueSymbol() || !patternSymbol.symbolType().isValueSymbol()) {
            return symbol;
        }

        return Literal.newLiteral(evaluate((Literal) sourceSymbol, (Literal) patternSymbol));
    }
View Full Code Here

    @Override
    public Symbol normalizeSymbol(Function function) {
        assert (function != null);
        assert function.arguments().size() == 2;

        Symbol left = function.arguments().get(0);
        Symbol right = function.arguments().get(1);

        if (left.symbolType().isValueSymbol() && right.symbolType().isValueSymbol()) {
            return Literal.newLiteral(evaluate((Input) left, (Input) right));
        }

        /***
         * true  or x    -> true
View Full Code Here

    }

    @Test
    public void testObjectLiteral() throws Exception {
        Symbol s = analyzeExpression("{}");
        assertThat(s, instanceOf(Literal.class));
        Literal l = (Literal)s;
        assertThat(l.value(), is((Object)new HashMap<String, Object>()));

        Literal objectLiteral = (Literal)analyzeExpression("{ident='value'}");
View Full Code Here

        module.register(new NoopFloorFunction(DataTypes.UNDEFINED));
    }

    @Override
    public Symbol normalizeSymbol(Function symbol) {
        Symbol argument = symbol.arguments().get(0);
        if (argument.symbolType().isValueSymbol()) {
            return Literal.newLiteral(info().returnType(), evaluate((Input) argument));
        }
        return symbol;
    }
View Full Code Here

        return info;
    }

    @Override
    public Symbol normalizeSymbol(Function symbol) {
        Symbol argument = symbol.arguments().get(0);

        if (argument.symbolType().isValueSymbol()) {
            return Literal.newLiteral(info().returnType(), evaluate((Input) argument));
        }

        return symbol;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Symbol normalizeSymbol(Function symbol) {
         assert symbol.arguments().size() == 2;

         Symbol left = symbol.arguments().get(0);
         Symbol right = symbol.arguments().get(1);

         if (left.symbolType().isValueSymbol() && right.symbolType().isValueSymbol()) {
             return Literal.newLiteral(info.returnType(), evaluate(new Input[]{(Input) left, (Input) right}));
         }
         return symbol;
    }
View Full Code Here

        module.register(new NoopRoundFunction(DataTypes.UNDEFINED));
    }

    @Override
    public Symbol normalizeSymbol(Function symbol) {
        Symbol argument = symbol.arguments().get(0);

        if (argument.symbolType().isValueSymbol()) {
            return Literal.newLiteral(info().returnType(), evaluate((Input) argument));
        }

        return symbol;
    }
View Full Code Here

        module.register(new NoopCeilFunction(DataTypes.UNDEFINED));
    }

    @Override
    public Symbol normalizeSymbol(Function symbol) {
        Symbol argument = symbol.arguments().get(0);
        if (argument.symbolType().isValueSymbol()) {
            return Literal.newLiteral(info().returnType(), evaluate((Input) argument));
        }
        return symbol;
    }
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.