Package org.apache.drill.exec.resolver

Examples of org.apache.drill.exec.resolver.FunctionResolver


        castArgs.add(new ValueExpressions.LongExpression(fromExpr.getMajorType().getPrecision(), null));
        castArgs.add(new ValueExpressions.LongExpression(fromExpr.getMajorType().getScale(), null));
      }

      FunctionCall castCall = new FunctionCall(castFuncName, castArgs, ExpressionPosition.UNKNOWN);
      FunctionResolver resolver = FunctionResolverFactory.getResolver(castCall);
      DrillFuncHolder matchedCastFuncHolder = registry.findDrillFunction(resolver, castCall);

      if (matchedCastFuncHolder == null) {
        logFunctionResolutionError(errorCollector, castCall);
        return NullExpression.INSTANCE;
View Full Code Here


      }

      //replace with a new function call, since its argument could be changed.
      call = new FunctionCall(call.getName(), args, call.getPosition());

      FunctionResolver resolver = FunctionResolverFactory.getResolver(call);
      DrillFuncHolder matchedFuncHolder = registry.findDrillFunction(resolver, call);

      if (matchedFuncHolder instanceof DrillComplexWriterFuncHolder && ! allowComplexWriter) {
        errorCollector.addGeneralError(call.getPosition(), "Only ProjectRecordBatch could have complex writer function. You are using complex writer function " + call.getName() + " in a non-project operation!");
      }
View Full Code Here

    private LogicalExpression getConvertToNullableExpr(List<LogicalExpression> args, MinorType minorType,
        FunctionImplementationRegistry registry) {
      String funcName = "convertToNullable" + minorType.toString();
      FunctionCall funcCall = new FunctionCall(funcName, args, ExpressionPosition.UNKNOWN);
      FunctionResolver resolver = FunctionResolverFactory.getResolver(funcCall);

      DrillFuncHolder matchedConvertToNullableFuncHolder = registry.findDrillFunction(resolver, funcCall);

      if (matchedConvertToNullableFuncHolder == null) {
        logFunctionResolutionError(errorCollector, funcCall);
View Full Code Here

    FunctionCall call = new FunctionCall(
        "hash",
        args,
        ExpressionPosition.UNKNOWN
    );
    FunctionResolver resolver = FunctionResolverFactory.getResolver(call);
    DrillFuncHolder matchedFuncHolder = registry.findDrillFunction(resolver, call);
    assertEquals( expectedBestInputMode, matchedFuncHolder.getParmMajorType(0).getMode());
  }
View Full Code Here

    FunctionCall call = new FunctionCall(
        "hash",
        args,
        ExpressionPosition.UNKNOWN
    );
    FunctionResolver resolver = FunctionResolverFactory.getResolver(call);
    DrillFuncHolder matchedFuncHolder = registry.findDrillFunction(resolver, call);
    assertEquals( expectedBestInputMode, matchedFuncHolder.getParmMajorType(0).getMode());
  }
View Full Code Here

        castArgs.add(new ValueExpressions.LongExpression(fromExpr.getMajorType().getPrecision(), null));
        castArgs.add(new ValueExpressions.LongExpression(fromExpr.getMajorType().getScale(), null));
      }

      FunctionCall castCall = new FunctionCall(castFuncName, castArgs, ExpressionPosition.UNKNOWN);
      FunctionResolver resolver = FunctionResolverFactory.getResolver(castCall);
      DrillFuncHolder matchedCastFuncHolder = registry.findDrillFunction(resolver, castCall);

      if (matchedCastFuncHolder == null) {
        logFunctionResolutionError(errorCollector, castCall);
        return NullExpression.INSTANCE;
View Full Code Here

      }

      //replace with a new function call, since its argument could be changed.
      call = new FunctionCall(call.getName(), args, call.getPosition());

      FunctionResolver resolver = FunctionResolverFactory.getResolver(call);
      DrillFuncHolder matchedFuncHolder = registry.findDrillFunction(resolver, call);

      if (matchedFuncHolder instanceof DrillComplexWriterFuncHolder && ! allowComplexWriter) {
        errorCollector.addGeneralError(call.getPosition(), "Only ProjectRecordBatch could have complex writer function. You are using complex writer function " + call.getName() + " in a non-project operation!");
      }
View Full Code Here

    private LogicalExpression getConvertToNullableExpr(List<LogicalExpression> args, MinorType minorType,
        FunctionImplementationRegistry registry) {
      String funcName = "convertToNullable" + minorType.toString();
      FunctionCall funcCall = new FunctionCall(funcName, args, ExpressionPosition.UNKNOWN);
      FunctionResolver resolver = FunctionResolverFactory.getResolver(funcCall);

      DrillFuncHolder matchedConvertToNullableFuncHolder = registry.findDrillFunction(resolver, funcCall);

      if (matchedConvertToNullableFuncHolder == null) {
        logFunctionResolutionError(errorCollector, funcCall);
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.resolver.FunctionResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.