当前位置: 首页>>代码示例>>Java>>正文


Java DataType.UNKNOWN属性代码示例

本文整理汇总了Java中org.apache.pig.data.DataType.UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java DataType.UNKNOWN属性的具体用法?Java DataType.UNKNOWN怎么用?Java DataType.UNKNOWN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.pig.data.DataType的用法示例。


在下文中一共展示了DataType.UNKNOWN属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FieldSchema

/**
 * Copy Constructor.
 * 
 * @param fs
 *           Source FieldSchema
 * 
 */
public FieldSchema(FieldSchema fs)  {
    if(null != fs) {
        alias = fs.alias;
        if(null != fs.schema) {
            schema = new Schema(fs.schema);
        } else {
            schema = null;
        }
        type = fs.type;
    } else {
        alias = null;
        schema = null;
        type = DataType.UNKNOWN;
    }
    canonicalName = CanonicalNamer.getNewName();
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:23,代码来源:Schema.java

示例2: mergeMROperProperties

private void mergeMROperProperties(MapReduceOper from, MapReduceOper to) {

        if (from.isEndOfAllInputSetInMap()) {
            to.setEndOfAllInputInMap(true);
        }

        if (from.isEndOfAllInputSetInReduce()) {
            to.setEndOfAllInputInReduce(true);
        }
        
        if (from.getRequestedParallelism() > to.getRequestedParallelism()) {
            to.requestedParallelism = from.requestedParallelism;
        }

        if (!from.UDFs.isEmpty()) {
            to.UDFs.addAll(from.UDFs);
        }

        if (from.needsDistinctCombiner()) {
            to.setNeedsDistinctCombiner(true);
        }

        if (to.mapKeyType == DataType.UNKNOWN) {
            to.mapKeyType = from.mapKeyType;
        }
    }
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:26,代码来源:MultiQueryOptimizer.java

示例3: mergeMROperProperties

private void mergeMROperProperties(MapReduceOper from, MapReduceOper to) {

        if (from.isEndOfAllInputSetInMap()) {
            to.setEndOfAllInputInMap(true);
        }

        if (from.isEndOfAllInputSetInReduce()) {
            to.setEndOfAllInputInReduce(true);
        }

        if (from.getRequestedParallelism() > to.getRequestedParallelism()) {
            to.requestedParallelism = from.requestedParallelism;
        }

        if (!from.UDFs.isEmpty()) {
            to.UDFs.addAll(from.UDFs);
        }

        if (from.needsDistinctCombiner()) {
            to.setNeedsDistinctCombiner(true);
        }

        if (to.mapKeyType == DataType.UNKNOWN) {
            to.mapKeyType = from.mapKeyType;
        }
    }
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:26,代码来源:MultiQueryOptimizer.java

示例4: outputSchema

@Override
public Schema outputSchema(Schema inputSch) {
    try {
        if (returnType == DataType.UNKNOWN) {
            return Schema.generateNestedSchema(DataType.BAG, DataType.NULL);
        } else {
            Schema outputTupleSchema = new Schema(new Schema.FieldSchema(returnName, returnType));
            return new Schema(new Schema.FieldSchema(
                    getSchemaName(this.getClass().getName().toLowerCase(), inputSch),
                        outputTupleSchema, 
                        DataType.BAG));
        }
    } catch (FrontendException fe) {
        throw new RuntimeException("Unable to create nested schema", fe);
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:16,代码来源:Over.java

示例5: getNext

@Override
public Tuple getNext() throws IOException {
  boolean next = false;
  try {
    next = reader.nextKeyValue();
  } catch (InterruptedException e) {
    throw new IOException(e);
  }
  
  if (!next) return null;
  
  key = reader.getCurrentKey();
  value = reader.getCurrentValue();
  
  if (keyType == DataType.UNKNOWN && key != null) {
      setKeyType(key.getClass());
  }
  if (valType == DataType.UNKNOWN && value != null) {
      setValueType(value.getClass());
  }
  
  mProtoTuple.add(translateWritableToPigDataType(key, keyType));
  mProtoTuple.add(translateWritableToPigDataType(value, valType));
  Tuple t =  mTupleFactory.newTuple(mProtoTuple);
  mProtoTuple.clear();
  return t;
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:27,代码来源:SequenceFileLoader.java

示例6: getNext

@Override
public Tuple getNext() throws IOException {
  boolean next = false;
  try {
    next = reader.nextKeyValue();
  } catch (InterruptedException e) {
    throw new IOException(e);
  }

  if (!next) return null;

  key = reader.getCurrentKey();
  value = reader.getCurrentValue();

  if (keyType == DataType.UNKNOWN && key != null) {
      setKeyType(key.getClass());
  }
  if (valType == DataType.UNKNOWN && value != null) {
      setValueType(value.getClass());
  }

  mProtoTuple.add(translateWritableToPigDataType(key, keyType));
  mProtoTuple.add(translateWritableToPigDataType(value, valType));
  Tuple t =  mTupleFactory.newTuple(mProtoTuple);
  mProtoTuple.clear();
  return t;
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:27,代码来源:SequenceFileLoader.java

示例7: isNullOrUnknownType

private boolean isNullOrUnknownType(FieldSchema fs) {
    return (fs.type == DataType.NULL || fs.type == DataType.UNKNOWN);
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:3,代码来源:Schema.java

示例8: readField

private Object readField(String line, ResourceFieldSchema field, FixedWidthField column) 
                         throws IOException, IllegalArgumentException {

    int start = column.start;
    int end = Math.min(column.end, line.length());

    if (start > line.length())
        return null;

    if (end <= start)
        return null;

    String s  = line.substring(start, end);
    String sTrim = s.trim();

    switch (field.getType()) {
        case DataType.UNKNOWN:
        case DataType.BYTEARRAY:
        case DataType.CHARARRAY:
            if (s.trim().length() == 0)
                return null;
            return s.trim();

        case DataType.BOOLEAN:
            return Boolean.parseBoolean(sTrim);

        case DataType.INTEGER:
            return Integer.parseInt(sTrim);

        case DataType.LONG:
            return Long.parseLong(sTrim);

        case DataType.FLOAT:
            return Float.parseFloat(sTrim);
        
        case DataType.DOUBLE:
            return Double.parseDouble(sTrim);

        case DataType.DATETIME:
            return (new DateTime(sTrim)).toDateTime(DateTimeZone.UTC);

        case DataType.MAP:
        case DataType.TUPLE:
        case DataType.BAG:
            throw new IllegalArgumentException("Object types (map, tuple, bag) are not supported by FixedWidthLoader");
        
        default:
            throw new IllegalArgumentException(
                "Unknown type in input schema: " + field.getType());
    }
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:51,代码来源:FixedWidthLoader.java

示例9: Over

public Over() {
    initialized = false;
    udfArgs = null;
    func = null;
    returnType = DataType.UNKNOWN;
}
 
开发者ID:sigmoidanalytics,项目名称:spork,代码行数:6,代码来源:Over.java

示例10: Column

/**
 * 
 * @param inputColumn
 *            A pair of integers representing the input number and the
 *            input column number
 */
public Column(Pair<Integer, Integer> inputColumn) {
    this(inputColumn, false, DataType.UNKNOWN);
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:9,代码来源:ProjectionMap.java


注:本文中的org.apache.pig.data.DataType.UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。