Package com.facebook.presto.sql.tree

Examples of com.facebook.presto.sql.tree.QualifiedName


    }

    @Override
    public InternalAggregationFunction getFunction()
    {
        return metadata.resolveFunction(new QualifiedName("var_pop"), ImmutableList.<Type>of(DOUBLE), false).getAggregationFunction();
    }
View Full Code Here


    }

    @Override
    public InternalAggregationFunction getFunction()
    {
        return metadata.resolveFunction(new QualifiedName("stddev_pop"), ImmutableList.<Type>of(DOUBLE), false).getAggregationFunction();
    }
View Full Code Here

        assertEquals(signature.getName(), "$literal$timestamp with time zone");
        assertEquals(signature.getArgumentTypes(), ImmutableList.of(BIGINT));
        assertEquals(signature.getReturnType(), TIMESTAMP_WITH_TIME_ZONE);

        FunctionRegistry registry = new FunctionRegistry(new TypeRegistry(), true);
        FunctionInfo function = registry.resolveFunction(new QualifiedName(signature.getName()), signature.getArgumentTypes(), false);
        assertEquals(function.getArgumentTypes(), ImmutableList.of(BIGINT));
        assertEquals(function.getReturnType(), TIMESTAMP_WITH_TIME_ZONE);
    }
View Full Code Here

    }

    @Override
    public InternalAggregationFunction getFunction()
    {
        return metadata.resolveFunction(new QualifiedName("stddev_samp"), ImmutableList.<Type>of(BIGINT), false).getAggregationFunction();
    }
View Full Code Here

    }

    @Override
    public InternalAggregationFunction getFunction()
    {
        return metadata.resolveFunction(new QualifiedName("var_samp"), ImmutableList.<Type>of(DOUBLE), false).getAggregationFunction();
    }
View Full Code Here

        assertEquals(signature.getArgumentTypes(), ImmutableList.of(BIGINT));
        assertEquals(signature.getReturnType(), TIMESTAMP_WITH_TIME_ZONE);
        assertEquals(signature.isApproximate(), false);

        FunctionRegistry registry = new FunctionRegistry(new TypeRegistry(), true);
        FunctionInfo function = registry.resolveFunction(new QualifiedName(signature.getName()), signature.getArgumentTypes(), signature.isApproximate());
        assertEquals(function.getArgumentTypes(), ImmutableList.of(BIGINT));
        assertEquals(function.getReturnType(), TIMESTAMP_WITH_TIME_ZONE);
    }
View Full Code Here

        assertEquals(signature.getArgumentTypes(), ImmutableList.of(BIGINT));
        assertEquals(signature.getReturnType(), TIMESTAMP_WITH_TIME_ZONE);
        assertEquals(signature.isApproximate(), false);

        FunctionRegistry registry = new FunctionRegistry(new TypeRegistry(), true);
        FunctionInfo function = registry.resolveFunction(new QualifiedName(signature.getName()), signature.getArgumentTypes(), signature.isApproximate());
        assertEquals(function.getArgumentTypes(), ImmutableList.of(BIGINT));
        assertEquals(function.getReturnType(), TIMESTAMP_WITH_TIME_ZONE);
    }
View Full Code Here

            }

            @Override
            protected Void visitQualifiedNameReference(QualifiedNameReference node, Integer indentLevel)
            {
                QualifiedName resolved = resolvedNameReferences.get(node);
                String resolvedName = "";
                if (resolved != null) {
                    resolvedName = "=>" + resolved.toString();
                }
                print(indentLevel, "QualifiedName[" + node.getName() + resolvedName + "]");
                return null;
            }
View Full Code Here

        return new SearchedCaseExpression(ImmutableList.of(new WhenClause(operand, result)), null);
    }

    public static Expression functionCall(String name, Expression... arguments)
    {
        return new FunctionCall(new QualifiedName(name), ImmutableList.copyOf(arguments));
    }
View Full Code Here

                throw new UnsupportedOperationException("not yet implemented: non-default precision");
            }

            switch (node.getType()) {
                case DATE:
                    return new FunctionCall(new QualifiedName("current_date"), ImmutableList.<Expression>of());
                case TIME:
                    return new FunctionCall(new QualifiedName("current_time"), ImmutableList.<Expression>of());
                case LOCALTIME:
                    return new FunctionCall(new QualifiedName("localtime"), ImmutableList.<Expression>of());
                case TIMESTAMP:
                    return new FunctionCall(new QualifiedName("current_timestamp"), ImmutableList.<Expression>of());
                case LOCALTIMESTAMP:
                    return new FunctionCall(new QualifiedName("localtimestamp"), ImmutableList.<Expression>of());
                default:
                    throw new UnsupportedOperationException("not yet implemented: " + node.getType());
            }
        }
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.tree.QualifiedName

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.