Package org.apache.drill.exec.expr.fn.DrillFuncHolder

Examples of org.apache.drill.exec.expr.fn.DrillFuncHolder.WorkspaceReference


        }
       
      }else{
        // workspace work.
//        logger.debug("Found workspace field {}:{}", field.getType(), field.getName());
        workspaceFields.add(new WorkspaceReference(field.getType(), field.getName()));
      }
     
    }
   
   
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())){
          MajorType majorType = null;
          try{
            majorType = getStaticFieldValue("TYPE", field.getType(), MajorType.class);
          }catch(Exception e){
            return failure("Failure while trying to access the ValueHolder's TYPE static variable.  All ValueHolders must contain a static TYPE variable that defines their MajorType.", e, clazz, field.getName());
          }
          wsReference.setMajorType(majorType);
        }

        workspaceFields.add(wsReference);
      }
View Full Code Here

        // workspace work.
        boolean isInject = inject != null;
        if (isInject && !field.getType().equals(DrillBuf.class)) {
          return failure(String.format("Only DrillBuf is allowed to be injected.  You attempted to inject %s.", field.getType()), clazz, field);
        }
        WorkspaceReference wsReference = new WorkspaceReference(field.getType(), field.getName(), isInject);

        if (!isInject && 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())) {
          MajorType majorType = null;
          try {
            majorType = getStaticFieldValue("TYPE", field.getType(), MajorType.class);
          } catch (Exception e) {
            return failure("Failure while trying to access the ValueHolder's TYPE static variable.  All ValueHolders must contain a static TYPE variable that defines their MajorType.", e, clazz, field.getName());
          }
          wsReference.setMajorType(majorType);
        }
        workspaceFields.add(wsReference);
      }
    }
View Full Code Here

      }else{
        // workspace work.
        boolean isInject = inject != null;
        if(isInject && !field.getType().equals(DrillBuf.class)) return failure(String.format("Only DrillBuf is allowed to be injected.  You attempted to inject %s.", field.getType()), clazz, field);
        WorkspaceReference wsReference = new WorkspaceReference(field.getType(), field.getName(), isInject);

        if (!isInject && 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())){
          MajorType majorType = null;
          try{
            majorType = getStaticFieldValue("TYPE", field.getType(), MajorType.class);
          }catch(Exception e){
            return failure("Failure while trying to access the ValueHolder's TYPE static variable.  All ValueHolders must contain a static TYPE variable that defines their MajorType.", e, clazz, field.getName());
          }
          wsReference.setMajorType(majorType);
        }

        workspaceFields.add(wsReference);
      }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.expr.fn.DrillFuncHolder.WorkspaceReference

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.