Examples of WritableConstantIntObjectInspector


Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantIntObjectInspector

        String typeName = oi.getTypeName();
        if(!INT_TYPE_NAME.equals(typeName)) {
            throw new UDFArgumentException("argument must be a int value: "
                    + TypeInfoUtils.getTypeInfoFromObjectInspector(oi));
        }
        WritableConstantIntObjectInspector intOI = (WritableConstantIntObjectInspector) oi;
        return intOI.getWritableConstantValue().get();
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantIntObjectInspector

        String typeName = numberOI.getTypeName();
        if(BIGINT_TYPE_NAME.equals(typeName)) {
            WritableConstantLongObjectInspector longOI = (WritableConstantLongObjectInspector) numberOI;
            return longOI.getWritableConstantValue().get();
        } else if(INT_TYPE_NAME.equals(typeName)) {
            WritableConstantIntObjectInspector intOI = (WritableConstantIntObjectInspector) numberOI;
            return (long) intOI.getWritableConstantValue().get();
        } else if(SMALLINT_TYPE_NAME.equals(typeName)) {
            WritableConstantShortObjectInspector shortOI = (WritableConstantShortObjectInspector) numberOI;
            return (long) shortOI.getWritableConstantValue().get();
        } else if(TINYINT_TYPE_NAME.equals(typeName)) {
            WritableConstantByteObjectInspector byteOI = (WritableConstantByteObjectInspector) numberOI;
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableConstantIntObjectInspector

      for(int i=0; i<parameters.length; ++i) {
        LOG.error(" ObjectInspector[ "+ i + " ] = " + parameters[0]);
      }
      if(parameters.length > 2) {
        if( parameters[2] instanceof WritableConstantIntObjectInspector ) {
          WritableConstantIntObjectInspector nvOI = (WritableConstantIntObjectInspector) parameters[2];
          numValues = nvOI.getWritableConstantValue().get();
          LOG.info(" Setting number of values to " + numValues);
        } else {
          throw new HiveException("Number of values must be a constant int.");
        }
      }
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.