Package org.apache.drill.exec.expr.annotations

Examples of org.apache.drill.exec.expr.annotations.FunctionTemplate.scope()


    // return holder
    ValueReference[] ps = params.toArray(new ValueReference[params.size()]);
    WorkspaceReference[] works = workspaceFields.toArray(new WorkspaceReference[workspaceFields.size()]);
   
    try{
      switch(template.scope()){
      case POINT_AGGREGATE:
        return new DrillAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(), template.name(), ps, outputField, works, methods, imports);
      case SIMPLE:
        DrillFuncHolder fh = new DrillSimpleFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(), template.name(), ps, outputField, works, methods, imports);
        return fh;
View Full Code Here


    WorkspaceReference[] works = workspaceFields.toArray(new WorkspaceReference[workspaceFields.size()]);
   
    try{
      switch(template.scope()){
      case POINT_AGGREGATE:
        return new DrillAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(), template.name(), ps, outputField, works, methods, imports);
      case SIMPLE:
        DrillFuncHolder fh = new DrillSimpleFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(), template.name(), ps, outputField, works, methods, imports);
        return fh;

      case HOLISTIC_AGGREGATE:
View Full Code Here

    try{
      switch(template.scope()){
      case POINT_AGGREGATE:
        return new DrillAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(), template.name(), ps, outputField, works, methods, imports);
      case SIMPLE:
        DrillFuncHolder fh = new DrillSimpleFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(), template.name(), ps, outputField, works, methods, imports);
        return fh;

      case HOLISTIC_AGGREGATE:
      case RANGE_AGGREGATE:
      default:
View Full Code Here

       
      }else{
        // workspace work.
        WorkspaceReference wsReference = new WorkspaceReference(field.getType(), field.getName());

        if (template.scope() == FunctionScope.POINT_AGGREGATE && !ValueHolder.class.isAssignableFrom(field.getType()) ) {
          return failure(String.format("Aggregate function '%s' workspace variable '%s' is of type '%s'. Please change it to Holder type.", template.name(), field.getName(), field.getType()), clazz, field);
        }

        //If the workspace var is of Holder type, get its MajorType and assign to WorkspaceReference.
        if(ValueHolder.class.isAssignableFrom(field.getType())){
View Full Code Here

      ValueReference[] ps = params.toArray(new ValueReference[params.size()]);
      WorkspaceReference[] works = workspaceFields.toArray(new WorkspaceReference[workspaceFields.size()]);


      String[] registeredNames = ((template.name().isEmpty()) ? template.names() : new String[] {template.name()} );
      switch(template.scope()){
      case POINT_AGGREGATE:
        return new DrillAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports, template.costCategory());
      case DECIMAL_AGGREGATE:
        return new DrillDecimalAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
View Full Code Here


      String[] registeredNames = ((template.name().isEmpty()) ? template.names() : new String[] {template.name()} );
      switch(template.scope()){
      case POINT_AGGREGATE:
        return new DrillAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports, template.costCategory());
      case DECIMAL_AGGREGATE:
        return new DrillDecimalAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports);
      case DECIMAL_SUM_AGGREGATE:
View Full Code Here

      switch(template.scope()){
      case POINT_AGGREGATE:
        return new DrillAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports, template.costCategory());
      case DECIMAL_AGGREGATE:
        return new DrillDecimalAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports);
      case DECIMAL_SUM_AGGREGATE:
        return new DrillDecimalSumAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports);
      case SIMPLE:
View Full Code Here

          template.isRandom(), registeredNames, ps, outputField, works, methods, imports, template.costCategory());
      case DECIMAL_AGGREGATE:
        return new DrillDecimalAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports);
      case DECIMAL_SUM_AGGREGATE:
        return new DrillDecimalSumAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports);
      case SIMPLE:
        if (outputField.isComplexWriter)
          return new DrillComplexWriterFuncHolder(template.scope(), template.nulls(),
              template.isBinaryCommutative(),
View Full Code Here

      case DECIMAL_SUM_AGGREGATE:
        return new DrillDecimalSumAggFuncHolder(template.scope(), template.nulls(), template.isBinaryCommutative(),
          template.isRandom(), registeredNames, ps, outputField, works, methods, imports);
      case SIMPLE:
        if (outputField.isComplexWriter)
          return new DrillComplexWriterFuncHolder(template.scope(), template.nulls(),
              template.isBinaryCommutative(),
              template.isRandom(), registeredNames,
              ps, outputField, works, methods, imports);
        else
          return new DrillSimpleFuncHolder(template.scope(), template.nulls(),
View Full Code Here

          return new DrillComplexWriterFuncHolder(template.scope(), template.nulls(),
              template.isBinaryCommutative(),
              template.isRandom(), registeredNames,
              ps, outputField, works, methods, imports);
        else
          return new DrillSimpleFuncHolder(template.scope(), template.nulls(),
                                           template.isBinaryCommutative(),
                                           template.isRandom(), registeredNames,
                                           ps, outputField, works, methods, imports, template.costCategory());
      case SC_BOOLEAN_OPERATOR:
        return new DrillBooleanOPHolder(template.scope(), template.nulls(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.