Examples of symbolType()


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

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

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

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

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

    @Override
    public Symbol normalizeSymbol(Function function) {
        assert (function.arguments().size() > 1);

        Symbol formatString = function.arguments().get(0);
        if (formatString.symbolType() != SymbolType.LITERAL
                && !((Literal)formatString).valueType().equals(DataTypes.STRING)) {
            // probably something like   format(column_with_format_string, arg1) ?
            return function;
        }
View Full Code Here

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

            }
        } else {
            validateType(arg1, arg1Type);
        }

        if (arg2.symbolType().isValueSymbol()) {
            numLiterals++;
            if (!arg2Type.equals(DataTypes.GEO_POINT)) {
                literalConverted = true;
                arg2 = Literal.toLiteral(arg2, DataTypes.GEO_POINT);
            }
View Full Code Here

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

            }
        } else {
            ensureShapeOrPoint(leftType);
        }

        if (right.symbolType().isValueSymbol()) {
            numLiterals++;
            if (rightType.equals(DataTypes.STRING)) {
                right = Literal.toLiteral(right, DataTypes.GEO_SHAPE);
                literalConverted = true;
            }
View Full Code Here

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

                        key,
                        ((QualifiedNameReference) expression).getName().toString()));
            }

            Symbol v = process(expression, context);
            if (!v.symbolType().isValueSymbol()) {
                throw new UnsupportedFeatureException("Only literals are allowed as parameter values");
            }
            builder.put(key, StringValueSymbolVisitor.INSTANCE.process(v));
        }
        return builder.build();
View Full Code Here

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

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

        Symbol arg = symbol.arguments().get(0);
        if (arg.equals(Literal.NULL) || arg.symbolType() == SymbolType.DYNAMIC_REFERENCE) {
            return Literal.newLiteral(true);
        } else if (arg.symbolType().isValueSymbol()) {
            return Literal.newLiteral(((Input) arg).value() == null);
        }
        return symbol;
View Full Code Here

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

        assert (symbol.arguments().size() == 1);

        Symbol arg = symbol.arguments().get(0);
        if (arg.equals(Literal.NULL) || arg.symbolType() == SymbolType.DYNAMIC_REFERENCE) {
            return Literal.newLiteral(true);
        } else if (arg.symbolType().isValueSymbol()) {
            return Literal.newLiteral(((Input) arg).value() == null);
        }
        return symbol;
    }
View Full Code Here

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

    @Override
    public Symbol normalizeSymbol(Function symbol) {
        assert symbol.arguments().size() == 1;
        Symbol argument = symbol.arguments().get(0);
        if (argument.symbolType().isValueSymbol()) {

            return Literal.newLiteral (returnType, returnType.value( ((Input)argument).value()));
        }
        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.