本文整理了Java中io.prestosql.sql.tree.QualifiedName.of
方法的一些代码示例,展示了QualifiedName.of
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QualifiedName.of
方法的具体详情如下:
包路径:io.prestosql.sql.tree.QualifiedName
类名称:QualifiedName
方法名:of
暂无
代码示例来源:origin: io.prestosql/presto-main
public static FunctionCall getCall(CurrentPath node)
{
return new FunctionCall(QualifiedName.of("$current_path"), ImmutableList.of());
}
}
代码示例来源:origin: io.prestosql/presto-main
public static FunctionCall getCall(CurrentUser node)
{
return new FunctionCall(QualifiedName.of("$current_user"), ImmutableList.of());
}
}
代码示例来源:origin: io.prestosql/presto-main
@Override
protected Void visitIdentifier(Identifier node, ImmutableSet.Builder<QualifiedName> builder)
{
builder.add(QualifiedName.of(node.getValue()));
return null;
}
}
代码示例来源:origin: prestosql/presto
public static QualifiedName of(String first, String... rest)
{
requireNonNull(first, "first is null");
return of(ImmutableList.copyOf(Lists.asList(first, rest)));
}
代码示例来源:origin: io.prestosql/presto-main
public static ExpectedValueProvider<FunctionCall> functionCall(
String name,
boolean distinct,
List<PlanTestSymbol> args)
{
return new FunctionCallProvider(QualifiedName.of(name), distinct, args);
}
代码示例来源:origin: io.prestosql/presto-parser
@Override
public Node visitConcatenation(SqlBaseParser.ConcatenationContext context)
{
return new FunctionCall(
getLocation(context.CONCAT()),
QualifiedName.of("concat"), ImmutableList.of(
(Expression) visit(context.left),
(Expression) visit(context.right)));
}
代码示例来源:origin: io.prestosql/presto-main
private WindowNode.Function newWindowNodeFunction(String functionName, Optional<Window> window, String... symbols)
{
return new WindowNode.Function(
new FunctionCall(
QualifiedName.of(functionName),
window,
false,
Arrays.stream(symbols).map(SymbolReference::new).collect(Collectors.toList())),
signature,
frame);
}
}
代码示例来源:origin: prestosql/presto
private WindowNode.Function newWindowNodeFunction(String functionName, Optional<Window> window, String... symbols)
{
return new WindowNode.Function(
new FunctionCall(
QualifiedName.of(functionName),
window,
false,
Arrays.stream(symbols).map(SymbolReference::new).collect(Collectors.toList())),
signature,
frame);
}
}
代码示例来源:origin: io.prestosql/presto-main
@Override
protected Type visitIdentifier(Identifier node, StackableAstVisitorContext<Context> context)
{
ResolvedField resolvedField = context.getContext().getScope().resolveField(node, QualifiedName.of(node.getValue()));
return handleResolvedField(node, resolvedField, context);
}
代码示例来源:origin: io.prestosql/presto-main
public static ExpectedValueProvider<FunctionCall> functionCall(
String name,
Optional<WindowFrame> frame,
List<String> args)
{
return new FunctionCallProvider(QualifiedName.of(name), frame, false, toSymbolAliases(args));
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testSetSessionWithParameters()
{
List<Expression> expressionList = new ArrayList<>();
expressionList.add(new StringLiteral("ban"));
expressionList.add(new Parameter(0));
testSetSessionWithParameters("bar", new FunctionCall(QualifiedName.of("concat"), expressionList), "banana", ImmutableList.of(new StringLiteral("ana")));
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testPrepare()
{
Query query = simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("foo")));
String sqlString = "PREPARE my_query FROM SELECT * FROM foo";
Map<String, String> statements = executePrepare("my_query", query, sqlString, TEST_SESSION);
assertEquals(statements, ImmutableMap.of("my_query", "SELECT *\nFROM\n foo\n"));
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testCreateTableNotExistsTrue()
{
CreateTable statement = new CreateTable(QualifiedName.of("test_table"),
ImmutableList.of(new ColumnDefinition(identifier("a"), "BIGINT", emptyList(), Optional.empty())),
true,
ImmutableList.of(),
Optional.empty());
getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList()));
assertEquals(metadata.getCreateTableCallCount(), 1);
}
代码示例来源:origin: prestosql/presto
@Test
public void testImplicitJoin()
{
assertStatement("SELECT * FROM a, b",
simpleQuery(selectList(new AllColumns()),
new Join(Join.Type.IMPLICIT,
new Table(QualifiedName.of("a")),
new Table(QualifiedName.of("b")),
Optional.empty())));
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testSelectStatement()
{
PreparedQuery preparedQuery = QUERY_PREPARER.prepareQuery(TEST_SESSION, "SELECT * FROM foo");
assertEquals(preparedQuery.getStatement(),
simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("foo"))));
}
代码示例来源:origin: prestosql/presto
protected final InternalAggregationFunction getFunction()
{
List<TypeSignatureProvider> parameterTypes = fromTypeSignatures(Lists.transform(getFunctionParameterTypes(), TypeSignature::parseTypeSignature));
Signature signature = functionRegistry.resolveFunction(QualifiedName.of(getFunctionName()), parameterTypes);
return functionRegistry.getAggregateFunctionImplementation(signature);
}
代码示例来源:origin: prestosql/presto
@Test
public void testDelete()
{
assertStatement("DELETE FROM t", new Delete(table(QualifiedName.of("t")), Optional.empty()));
assertStatement("DELETE FROM \"awesome table\"", new Delete(table(QualifiedName.of("awesome table")), Optional.empty()));
assertStatement("DELETE FROM t WHERE a = b", new Delete(table(QualifiedName.of("t")), Optional.of(
new ComparisonExpression(ComparisonExpression.Operator.EQUAL,
new Identifier("a"),
new Identifier("b")))));
}
代码示例来源:origin: prestosql/presto
@Test
public void testExplainVerbose()
{
assertStatement("EXPLAIN VERBOSE SELECT * FROM t",
new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, true, ImmutableList.of()));
}
代码示例来源:origin: io.prestosql/presto-main
private Signature resolveSignature()
{
FunctionRegistry functionRegistry = new FunctionRegistry(typeRegistry, blockEncoding, new FeaturesConfig());
functionRegistry.addFunctions(createFunctionsFromSignatures());
return functionRegistry.resolveFunction(QualifiedName.of(TEST_FUNCTION_NAME), fromTypeSignatures(parameterTypes));
}
代码示例来源:origin: prestosql/presto
private Signature resolveSignature()
{
FunctionRegistry functionRegistry = new FunctionRegistry(typeRegistry, blockEncoding, new FeaturesConfig());
functionRegistry.addFunctions(createFunctionsFromSignatures());
return functionRegistry.resolveFunction(QualifiedName.of(TEST_FUNCTION_NAME), fromTypeSignatures(parameterTypes));
}
内容来源于网络,如有侵权,请联系作者删除!