当前位置: 首页>>代码示例>>Java>>正文


Java QualifiedName.of方法代码示例

本文整理汇总了Java中com.facebook.presto.sql.tree.QualifiedName.of方法的典型用法代码示例。如果您正苦于以下问题:Java QualifiedName.of方法的具体用法?Java QualifiedName.of怎么用?Java QualifiedName.of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.presto.sql.tree.QualifiedName的用法示例。


在下文中一共展示了QualifiedName.of方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitSample

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
@Override
public PlanNode visitSample(SampleNode node, RewriteContext<Void> context)
{
    if (node.getSampleType() == SampleNode.Type.BERNOULLI) {
        PlanNode rewrittenSource = context.rewrite(node.getSource());

        ComparisonExpression expression = new ComparisonExpression(
                ComparisonExpression.Type.LESS_THAN,
                new FunctionCall(QualifiedName.of("rand"), ImmutableList.<Expression>of()),
                new DoubleLiteral(Double.toString(node.getSampleRatio())));
        return new FilterNode(node.getId(), rewrittenSource, expression);
    }
    else if (node.getSampleType() == SampleNode.Type.POISSONIZED ||
            node.getSampleType() == SampleNode.Type.SYSTEM) {
        return context.defaultRewrite(node);
    }
    throw new UnsupportedOperationException("not yet implemented");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:19,代码来源:ImplementSampleAsFilter.java

示例2: createFailureFunction

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
@VisibleForTesting
@NotNull
public static Expression createFailureFunction(RuntimeException exception, Type type)
{
    requireNonNull(exception, "Exception is null");

    String failureInfo = JsonCodec.jsonCodec(FailureInfo.class).toJson(Failures.toFailure(exception).toFailureInfo());
    FunctionCall jsonParse = new FunctionCall(QualifiedName.of("json_parse"), ImmutableList.of(new StringLiteral(failureInfo)));
    FunctionCall failureFunction = new FunctionCall(QualifiedName.of("fail"), ImmutableList.of(jsonParse));

    return new Cast(failureFunction, type.getTypeSignature().toString());
}
 
开发者ID:y-lan,项目名称:presto,代码行数:13,代码来源:ExpressionInterpreter.java

示例3: rewriteFunctionCall

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
@Override
public Expression rewriteFunctionCall(FunctionCall node, Object context, ExpressionTreeRewriter<Object> treeRewriter)
{
    if (node.getName().equals(QualifiedName.of("fail"))) {
        return new FunctionCall(QualifiedName.of("fail"), ImmutableList.of());
    }
    return node;
}
 
开发者ID:y-lan,项目名称:presto,代码行数:9,代码来源:TestExpressionInterpreter.java

示例4: visitAtTimeZone

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
@Override
public Node visitAtTimeZone(SqlBaseParser.AtTimeZoneContext context)
{
    return new FunctionCall(
            getLocation(context.AT()),
            QualifiedName.of("at_timezone"), ImmutableList.of(
            (Expression) visit(context.valueExpression()),
            (Expression) visit(context.timeZoneSpecifier())));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:10,代码来源:AstBuilder.java

示例5: visitFunctionCall

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
@Override
protected String visitFunctionCall(FunctionCall node, Boolean unmangleNames)
{
    StringBuilder builder = new StringBuilder();

    String arguments = joinExpressions(node.getArguments(), unmangleNames);
    if (node.getArguments().isEmpty() && "count".equalsIgnoreCase(node.getName().getSuffix())) {
        arguments = "*";
    }
    if (node.isDistinct()) {
        arguments = "DISTINCT " + arguments;
    }

    if (unmangleNames && node.getName().toString().startsWith(QueryUtil.FIELD_REFERENCE_PREFIX)) {
        checkState(node.getArguments().size() == 1, "Expected only one argument to field reference");
        QualifiedName name = QualifiedName.of(QueryUtil.unmangleFieldReference(node.getName().toString()));
        builder.append(arguments).append(".").append(name);
    }
    else {
        builder.append(formatQualifiedName(node.getName()))
                .append('(').append(arguments).append(')');
    }

    if (node.getWindow().isPresent()) {
        builder.append(" OVER ").append(visitWindow(node.getWindow().get(), unmangleNames));
    }

    return builder.toString();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:30,代码来源:ExpressionFormatter.java

示例6: testInsertInto

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
@Test
public void testInsertInto()
        throws Exception
{
    QualifiedName table = QualifiedName.of("a");
    Query query = simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t")));

    assertStatement("INSERT INTO a SELECT * FROM t",
            new Insert(table, Optional.empty(), query));

    assertStatement("INSERT INTO a (c1, c2) SELECT * FROM t",
            new Insert(table, Optional.of(ImmutableList.of("c1", "c2")), query));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:14,代码来源:TestSqlParser.java

示例7: getHashFunctionCall

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
private static Expression getHashFunctionCall(Expression previousHashValue, Symbol symbol)
{
    FunctionCall functionCall = new FunctionCall(QualifiedName.of(HASH_CODE), Optional.<Window>empty(), false, ImmutableList.<Expression>of(new QualifiedNameReference(symbol.toQualifiedName())));
    List<Expression> arguments = ImmutableList.of(previousHashValue, orNullHashCode(functionCall));
    return new FunctionCall(QualifiedName.of("combine_hash"), arguments);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:HashGenerationOptimizer.java

示例8: toQualifiedName

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
public QualifiedName toQualifiedName()
{
    return QualifiedName.of(name);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:Symbol.java

示例9: colorLiteral

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
private static FunctionCall colorLiteral(long value)
{
    return new FunctionCall(QualifiedName.of(getMagicLiteralFunctionSignature(COLOR).getName()), ImmutableList.<Expression>of(longLiteral(value)));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:TestDomainTranslator.java

示例10: function

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
private static FunctionCall function(String functionName, Expression... args)
{
    return new FunctionCall(QualifiedName.of(functionName), ImmutableList.copyOf(args));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:TestDomainTranslator.java

示例11: fakeFunction

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
private static FunctionCall fakeFunction(String name)
{
    return new FunctionCall(QualifiedName.of("test"), ImmutableList.<Expression>of());
}
 
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:TestEffectivePredicateExtractor.java

示例12: input

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
private static QualifiedNameReference input(String symbol)
{
    return new QualifiedNameReference(QualifiedName.of(symbol));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:TestDeterminismEvaluator.java

示例13: nameReference

import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
public static Expression nameReference(String name)
{
    return new QualifiedNameReference(QualifiedName.of(name));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:QueryUtil.java


注:本文中的com.facebook.presto.sql.tree.QualifiedName.of方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。