本文整理了Java中io.prestosql.sql.tree.QualifiedName.equals
方法的一些代码示例,展示了QualifiedName.equals
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QualifiedName.equals
方法的具体详情如下:
包路径:io.prestosql.sql.tree.QualifiedName
类名称:QualifiedName
方法名:equals
暂无
代码示例来源:origin: prestosql/presto
@Override
protected Void visitFunctionCall(FunctionCall node, AtomicBoolean deterministic)
{
// TODO: total hack to figure out if a function is deterministic. martint should fix this when he refactors the planning code
if (node.getName().equals(QualifiedName.of("rand")) ||
node.getName().equals(QualifiedName.of("random")) ||
node.getName().equals(QualifiedName.of("shuffle"))) {
deterministic.set(false);
}
return super.visitFunctionCall(node, deterministic);
}
}
代码示例来源:origin: io.prestosql/presto-main
@Override
protected Void visitFunctionCall(FunctionCall node, AtomicBoolean deterministic)
{
// TODO: total hack to figure out if a function is deterministic. martint should fix this when he refactors the planning code
if (node.getName().equals(QualifiedName.of("rand")) ||
node.getName().equals(QualifiedName.of("random")) ||
node.getName().equals(QualifiedName.of("shuffle"))) {
deterministic.set(false);
}
return super.visitFunctionCall(node, deterministic);
}
}
代码示例来源:origin: prestosql/presto
FunctionCall call = entry.getValue().getCall();
Symbol symbol = entry.getKey();
if (call.getName().equals(COUNT)) {
List<TypeSignature> scalarAggregationSourceTypeSignatures = ImmutableList.of(
symbolAllocator.getTypes().get(nonNullableAggregationSourceSymbol).getTypeSignature());
代码示例来源:origin: io.prestosql/presto-main
FunctionCall call = entry.getValue().getCall();
Symbol symbol = entry.getKey();
if (call.getName().equals(COUNT)) {
List<TypeSignature> scalarAggregationSourceTypeSignatures = ImmutableList.of(
symbolAllocator.getTypes().get(nonNullableAggregationSourceSymbol).getTypeSignature());
代码示例来源:origin: io.prestosql/presto-main
@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;
}
}
代码示例来源:origin: prestosql/presto
@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;
}
}
代码示例来源:origin: io.prestosql/presto-main
@Override
protected Object visitFunctionCall(FunctionCall node, Object context)
{
List<Type> argumentTypes = new ArrayList<>();
List<Object> argumentValues = new ArrayList<>();
for (Expression expression : node.getArguments()) {
Object value = process(expression, context);
Type type = type(expression);
argumentValues.add(value);
argumentTypes.add(type);
}
Signature functionSignature = metadata.getFunctionRegistry().resolveFunction(node.getName(), fromTypes(argumentTypes));
ScalarFunctionImplementation function = metadata.getFunctionRegistry().getScalarFunctionImplementation(functionSignature);
for (int i = 0; i < argumentValues.size(); i++) {
Object value = argumentValues.get(i);
if (value == null && function.getArgumentProperty(i).getNullConvention() == RETURN_NULL_ON_NULL) {
return null;
}
}
// do not optimize non-deterministic functions
if (optimize && (!function.isDeterministic() || hasUnresolvedValue(argumentValues) || node.getName().equals(QualifiedName.of("fail")))) {
return new FunctionCall(node.getName(), node.getWindow(), node.isDistinct(), toExpressions(argumentValues, argumentTypes));
}
return functionInvoker.invoke(functionSignature, session, argumentValues);
}
代码示例来源:origin: prestosql/presto
@Override
protected Object visitFunctionCall(FunctionCall node, Object context)
{
List<Type> argumentTypes = new ArrayList<>();
List<Object> argumentValues = new ArrayList<>();
for (Expression expression : node.getArguments()) {
Object value = process(expression, context);
Type type = type(expression);
argumentValues.add(value);
argumentTypes.add(type);
}
Signature functionSignature = metadata.getFunctionRegistry().resolveFunction(node.getName(), fromTypes(argumentTypes));
ScalarFunctionImplementation function = metadata.getFunctionRegistry().getScalarFunctionImplementation(functionSignature);
for (int i = 0; i < argumentValues.size(); i++) {
Object value = argumentValues.get(i);
if (value == null && function.getArgumentProperty(i).getNullConvention() == RETURN_NULL_ON_NULL) {
return null;
}
}
// do not optimize non-deterministic functions
if (optimize && (!function.isDeterministic() || hasUnresolvedValue(argumentValues) || node.getName().equals(QualifiedName.of("fail")))) {
return new FunctionCall(node.getName(), node.getWindow(), node.isDistinct(), toExpressions(argumentValues, argumentTypes));
}
return functionInvoker.invoke(functionSignature, session, argumentValues);
}
代码示例来源:origin: io.prestosql/presto-main
@Override
protected Boolean visitFunctionCall(FunctionCall actual, Node expected)
{
if (!(expected instanceof FunctionCall)) {
return false;
}
FunctionCall expectedFunction = (FunctionCall) expected;
if (actual.isDistinct() != expectedFunction.isDistinct()) {
return false;
}
if (!actual.getName().equals(expectedFunction.getName())) {
return false;
}
if (!process(actual.getArguments(), expectedFunction.getArguments())) {
return false;
}
if (!process(actual.getFilter(), expectedFunction.getFilter())) {
return false;
}
if (!process(actual.getWindow(), expectedFunction.getWindow())) {
return false;
}
return true;
}
代码示例来源:origin: prestosql/presto
@Override
protected Boolean visitFunctionCall(FunctionCall actual, Node expected)
{
if (!(expected instanceof FunctionCall)) {
return false;
}
FunctionCall expectedFunction = (FunctionCall) expected;
if (actual.isDistinct() != expectedFunction.isDistinct()) {
return false;
}
if (!actual.getName().equals(expectedFunction.getName())) {
return false;
}
if (!process(actual.getArguments(), expectedFunction.getArguments())) {
return false;
}
if (!process(actual.getFilter(), expectedFunction.getFilter())) {
return false;
}
if (!process(actual.getWindow(), expectedFunction.getWindow())) {
return false;
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!