hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Maughan <>
Subject ORC HiveChar, HiveVarchar & HiveDecimal
Date Wed, 01 Apr 2015 09:56:58 GMT

I'm attempting to write a ReaderReader and RecordWriter for ORC that
support reading and writing String for HiveChar and HiveVarchar and
BigDecimal for HiveDecimal to simplify usage a little - I need Serializable

To do this I've gone the ObjectInspector route, eg:

  ... extends JavaHiveCharObjectInspector {

  public HiveCharWritable getPrimitiveWritableObject(Object o) {
    if (o == null) {
      return null;
    if (o instanceof String) {
      o = new HiveChar((String) o, getMaxLength());
    return super.getPrimitiveWritableObject(o);

To get the object nesting working I've also had to implement a factory that
delegates to my ObjectInspectors when CharTypeInfo, VarcharTypeInfo or
DecimalTypeInfo are encountered during the traversal of the TypeInfo tree.

I've got this all working except for one minor problem. In my
StructObjectInspector I need access to the OrcStruct constructor and the
getFieldValue and setFieldValue methods. All of these are package private.
Would it acceptable to submit a patch to make these public or is it
preferable to keep them package private? Alternatively, is there another
way to achieve what I'm trying to do that I've missed?


View raw message