public static List<RowExpression> flattenNestedCallArgs(CallExpression call) { String callName = call.getSignature().getName(); ImmutableList.Builder<RowExpression> newArguments = ImmutableList.builder(); for (RowExpression argument : call.getArguments()) { if (argument instanceof CallExpression && callName.equals(((CallExpression) argument).getSignature().getName())) { // same call type, so flatten the args newArguments.addAll(flattenNestedCallArgs((CallExpression) argument)); } else { newArguments.add(argument); } } return newArguments.build(); }
@Override public RowExpression visitCall(CallExpression call, Void context) { return new CallExpression(call.getSignature(), targetType, call.getArguments()); }
@Override public RowExpression visitCall(CallExpression call, Void context) { return new CallExpression( call.getSignature(), call.getType(), call.getArguments().stream() .map(expression -> expression.accept(this, context)) .collect(toImmutableList())); }
@Override public Boolean visitCall(CallExpression call, Void context) { Signature signature = call.getSignature(); if (registry.isRegistered(signature) && !registry.getScalarFunctionImplementation(signature).isDeterministic()) { return false; } return call.getArguments().stream() .allMatch(expression -> expression.accept(this, context)); }
call.getSignature(), call.getType(), call.getArguments().stream() .collect(toImmutableList())); String callName = call.getSignature().getName(); call.getSignature(), call.getType(), ROW_EXPRESSION_ORDERING.sortedCopy(call.getArguments())); callName.equals(mangleOperatorName(GREATER_THAN)) ? mangleOperatorName(LESS_THAN) : mangleOperatorName(LESS_THAN_OR_EQUAL), SCALAR, call.getSignature().getTypeVariableConstraints(), call.getSignature().getLongVariableConstraints(), call.getSignature().getReturnType(), swapPair(call.getSignature().getArgumentTypes()), false), call.getType(),
CallExpression rightCall = (CallExpression) right; return ComparisonChain.start() .compare(leftCall.getSignature().toString(), rightCall.getSignature().toString()) .compare(leftCall.getArguments(), rightCall.getArguments(), argumentComparator) .result();
if (innerCall.getSignature().getName().equals("json_parse")) { checkArgument(innerCall.getType().equals(JSON)); checkArgument(innerCall.getArguments().size() == 1); TypeSignature returnType = call.getSignature().getReturnType(); if (returnType.getBase().equals(ARRAY)) { return call(
@Override public RowExpression visitCall(CallExpression call, Void context) if (call.getSignature().getName().equals(CAST)) { call = rewriteCast(call); Signature signature = call.getSignature();
if (last instanceof CallExpression && ((CallExpression) last).getSignature().getName().equals("WHEN")) { whenClauses = arguments.subList(1, arguments.size()); elseValue = new BytecodeBlock() Preconditions.checkArgument(clause instanceof CallExpression && ((CallExpression) clause).getSignature().getName().equals("WHEN"));
if (call.getSignature().getName().equals(CAST)) { generator = new CastCodeGenerator(); switch (call.getSignature().getName()) { registry); return generator.generateExpression(call.getSignature(), generatorContext, call.getType(), call.getArguments(), context.getOutputBlockVariable());
public static List<RowExpression> flattenNestedCallArgs(CallExpression call) { String callName = call.getSignature().getName(); ImmutableList.Builder<RowExpression> newArguments = ImmutableList.builder(); for (RowExpression argument : call.getArguments()) { if (argument instanceof CallExpression && callName.equals(((CallExpression) argument).getSignature().getName())) { // same call type, so flatten the args newArguments.addAll(flattenNestedCallArgs((CallExpression) argument)); } else { newArguments.add(argument); } } return newArguments.build(); }
@Override public RowExpression visitCall(CallExpression call, Void context) { return new CallExpression(call.getSignature(), targetType, call.getArguments()); }
@Override public BytecodeNode visitCall(CallExpression call, Scope scope) { if (call.getSignature().getName().equals(TRY)) { checkState(call.getArguments().size() == 1, "try call expressions must have a single argument"); checkState(getOnlyElement(call.getArguments()) instanceof CallExpression, "try call expression argument must be a call expression"); tryExpressions.add((CallExpression) getOnlyElement(call.getArguments())); } for (RowExpression rowExpression : call.getArguments()) { rowExpression.accept(this, null); } return null; }
@Override public Boolean visitCall(CallExpression call, Void context) { Signature signature = call.getSignature(); if (registry.isRegistered(signature) && !registry.getScalarFunctionImplementation(signature).isDeterministic()) { return false; } return call.getArguments().stream() .allMatch(expression -> expression.accept(this, context)); } }
CallExpression rightCall = (CallExpression) right; return ComparisonChain.start() .compare(leftCall.getSignature().toString(), rightCall.getSignature().toString()) .compare(leftCall.getArguments(), rightCall.getArguments(), argumentComparator) .result();
call.getSignature(), call.getType(), call.getArguments().stream() .collect(toImmutableList())); String callName = call.getSignature().getName(); call.getSignature(), call.getType(), ROW_EXPRESSION_ORDERING.sortedCopy(call.getArguments())); callName.equals(mangleOperatorName(GREATER_THAN)) ? mangleOperatorName(LESS_THAN) : mangleOperatorName(LESS_THAN_OR_EQUAL), SCALAR, call.getSignature().getTypeParameterRequirements(), call.getSignature().getReturnType(), swapPair(call.getSignature().getArgumentTypes()), false), call.getType(),
if (call.getSignature().getName().equals(CAST)) { generator = new CastCodeGenerator(); switch (call.getSignature().getName()) { registry); return generator.generateExpression(call.getSignature(), generatorContext, call.getType(), call.getArguments());
Signature signature = call.getSignature();
if (last instanceof CallExpression && ((CallExpression) last).getSignature().getName().equals("WHEN")) { whenClauses = arguments.subList(1, arguments.size()); elseValue = new BytecodeBlock() Preconditions.checkArgument(clause instanceof CallExpression && ((CallExpression) clause).getSignature().getName().equals("WHEN"));