Java Code Examples for org.apache.hadoop.hive.serde2.objectinspector.primitive.VoidObjectInspector

The following examples show how to use org.apache.hadoop.hive.serde2.objectinspector.primitive.VoidObjectInspector. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public StructConverter(ObjectInspector inputOI, SettableStructObjectInspector outputOI) {
  if (inputOI instanceof StructObjectInspector) {
    this.inputOI = (StructObjectInspector) inputOI;
    this.outputOI = outputOI;
    inputFields = this.inputOI.getAllStructFieldRefs();
    outputFields = outputOI.getAllStructFieldRefs();

    // If the output has some extra fields, set them to NULL.
    int minFields = Math.min(inputFields.size(), outputFields.size());
    fieldConverters = new ArrayList<Converter>(minFields);
    for (int f = 0; f < minFields; f++) {
      fieldConverters.add(getConverter(inputFields.get(f).getFieldObjectInspector(),
          outputFields.get(f).getFieldObjectInspector()));
    }
  } else if (!(inputOI instanceof VoidObjectInspector)) {
    throw new UnsupportedOperationException(
        "Hive internal error: conversion of " + inputOI.getTypeName() + " to " + outputOI.getTypeName()
            + "not supported yet.");
  }
}
 
Example 2
public MapConverter(ObjectInspector inputOI, SettableMapObjectInspector outputOI) {
  if (inputOI instanceof MapObjectInspector) {
    this.inputOI = (MapObjectInspector) inputOI;
    this.outputOI = outputOI;
    inputKeyOI = this.inputOI.getMapKeyObjectInspector();
    outputKeyOI = outputOI.getMapKeyObjectInspector();
    inputValueOI = this.inputOI.getMapValueObjectInspector();
    outputValueOI = outputOI.getMapValueObjectInspector();
    keyConverter = getConverter(inputKeyOI, outputKeyOI);
    valueConverter = getConverter(inputValueOI, outputValueOI);
  } else if (!(inputOI instanceof VoidObjectInspector)) {
    throw new UnsupportedOperationException(
        "Hive internal error: conversion of " + inputOI.getTypeName() + " to " + outputOI.getTypeName()
            + "not supported yet.");
  }
}
 
Example 3
public ListConverter(ObjectInspector inputOI, SettableListObjectInspector outputOI) {
  if (inputOI instanceof ListObjectInspector) {
    this.inputOI = (ListObjectInspector) inputOI;
    this.outputOI = outputOI;
    inputElementOI = this.inputOI.getListElementObjectInspector();
    outputElementOI = outputOI.getListElementObjectInspector();
    elementConverter = getConverter(inputElementOI, outputElementOI);
  } else if (!(inputOI instanceof VoidObjectInspector)) {
    throw new UnsupportedOperationException(
        "Hive internal error: conversion of " + inputOI.getTypeName() + " to " + outputOI.getTypeName()
            + "not supported yet.");
  }
}
 
Example 4
Source Project: transport   Source File: HiveTypeSystem.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
protected boolean isUnknownType(ObjectInspector dataType) {
  return dataType instanceof VoidObjectInspector;
}
 
Example 5
Source Project: transport   Source File: HiveUnknownType.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
public HiveUnknownType(VoidObjectInspector voidObjectInspector) {
  _voidObjectInspector = voidObjectInspector;
}