本文整理汇总了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");
}
示例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());
}
示例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;
}
示例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())));
}
示例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();
}
示例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));
}
示例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);
}
示例8: toQualifiedName
import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
public QualifiedName toQualifiedName()
{
return QualifiedName.of(name);
}
示例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)));
}
示例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));
}
示例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());
}
示例12: input
import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
private static QualifiedNameReference input(String symbol)
{
return new QualifiedNameReference(QualifiedName.of(symbol));
}
示例13: nameReference
import com.facebook.presto.sql.tree.QualifiedName; //导入方法依赖的package包/类
public static Expression nameReference(String name)
{
return new QualifiedNameReference(QualifiedName.of(name));
}