Examples of symbolType()


Examples of io.crate.planner.symbol.Literal.symbolType()

        assertThat(s, instanceOf(Literal.class));
        Literal l = (Literal)s;
        assertThat(l.value(), is((Object)new HashMap<String, Object>()));

        Literal objectLiteral = (Literal)analyzeExpression("{ident='value'}");
        assertThat(objectLiteral.symbolType(), is(SymbolType.LITERAL));
        assertThat(objectLiteral.valueType(), is((DataType)ObjectType.INSTANCE));
        assertThat(objectLiteral.value(), is((Object) new MapBuilder<String, Object>().put("ident", "value").map()));

        Literal multipleObjectLiteral = (Literal)analyzeExpression("{\"Ident\"=123.4, a={}, ident='string'}");
        Map<String, Object> values = (Map<String, Object>)multipleObjectLiteral.value();
View Full Code Here

Examples of io.crate.planner.symbol.Symbol.symbolType()

    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

Examples of io.crate.planner.symbol.Symbol.symbolType()

        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

Examples of io.crate.planner.symbol.Symbol.symbolType()

        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

Examples of io.crate.planner.symbol.Symbol.symbolType()

    }

    @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

Examples of io.crate.planner.symbol.Symbol.symbolType()

    @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

Examples of io.crate.planner.symbol.Symbol.symbolType()

         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

Examples of io.crate.planner.symbol.Symbol.symbolType()

    @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

Examples of io.crate.planner.symbol.Symbol.symbolType()

    }

    @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

Examples of io.crate.planner.symbol.Symbol.symbolType()

    }

    @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
Copyright © 2018 www.massapi.com. 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.