@Override public Boolean visitFunctionCall(FunctionCall call, LogicalExpression valueArg) { Matcher matcher = convertFromPattern.matcher(call.getName()); if (matcher.find()) { // convert function call to ConvertExpression ConvertExpression convert = new ConvertExpression(ConvertExpression.CONVERT_FROM, matcher.group(1), call.args.get(0), call.getPosition()); return visitConvertExpression(convert, valueArg); } return false; }
@Override public Boolean visitFunctionCall(FunctionCall call, LogicalExpression valueArg) { Matcher matcher = convertFromPattern.matcher(call.getName()); if (matcher.find()) { // convert function call to ConvertExpression ConvertExpression convert = new ConvertExpression(ConvertExpression.CONVERT_FROM, matcher.group(1), call.args.get(0), call.getPosition()); return visitConvertExpression(convert, valueArg); } return false; }
private static void logFunctionResolutionError(ErrorCollector errorCollector, FunctionCall call) { // add error to collector StringBuilder sb = new StringBuilder(); sb.append("Missing function implementation: "); sb.append("["); sb.append(call.getName()); sb.append("("); boolean first = true; for(LogicalExpression e : call.args) { TypeProtos.MajorType mt = e.getMajorType(); if (first) { first = false; } else { sb.append(", "); } sb.append(mt.getMinorType().name()); sb.append("-"); sb.append(mt.getMode().name()); } sb.append(")"); sb.append("]"); errorCollector.addGeneralError(call.getPosition(), sb.toString()); }
@Override public LogicalExpression visitFunctionCall(FunctionCall call, Void value) throws RuntimeException { List<LogicalExpression> args = Lists.newArrayList(); for (LogicalExpression arg : call.args) { args.add(arg.accept(this, null)); } return new FunctionCall(call.getName(), args, call.getPosition()); }
errorCollector = new ErrorCollectorImpl(); LogicalExpression thenExpression = new FunctionCall(call.getName(), newArgs, call.getPosition()).accept(this, functionLookupContext);
call = new FunctionCall(call.getName(), args, call.getPosition()); errorCollector.addGeneralError(call.getPosition(), "Only ProjectRecordBatch could have complex writer function. You are using complex writer function " + call.getName() + " in a non-project operation!"); FunctionHolderExpression funcExpr = matchedFuncHolder.getExpr(call.getName(), argsWithCast, call.getPosition()); MajorType funcExprMajorType = funcExpr.getMajorType(); if (DecimalUtility.isObsoleteDecimalType(funcExprMajorType.getMinorType())) { return matchedNonDrillFuncHolder.getExpr(call.getName(), extArgsWithCast, call.getPosition());