@Override public final Object deserialize(Writable blob) throws SerDeException { if (!this.charset.equals(Charsets.UTF_8)) { blob = transformToUTF8(blob); } return doDeserialize(blob); }
@Override public final Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { Writable result = doSerialize(obj, objInspector); if (!this.charset.equals(Charsets.UTF_8)) { result = transformFromUTF8(result); } return result; }
/** * Initialize the SerDe given the parameters. serialization.format: separator * char or byte code (only supports byte-value up to 127) columns: * ","-separated column names columns.types: ",", ":", or ";"-separated column * types * * @see org.apache.hadoop.hive.serde2.AbstractSerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration job, Properties tbl) throws SerDeException { super.initialize(job, tbl); serdeParams = new LazySerDeParameters(job, tbl, getClass().getName()); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), new LazyObjectInspectorParametersImpl(serdeParams)); cachedLazyStruct = (LazyStruct) LazyFactory .createLazyObject(cachedObjectInspector); serializedSize = 0; stats = new SerDeStats(); lastOperationSerialize = false; lastOperationDeserialize = false; }
@Override public final Object deserialize(Writable blob) throws SerDeException { if (!this.charset.equals(Charsets.UTF_8)) { blob = transformToUTF8(blob); } return doDeserialize(blob); }
@Override public final Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { Writable result = doSerialize(obj, objInspector); if (!this.charset.equals(Charsets.UTF_8)) { result = transformFromUTF8(result); } return result; }
@Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { // get the SerDe parameters super.initialize(conf, tbl); serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); fieldDelimited = tbl.getProperty(serdeConstants.FIELD_DELIM); if (fieldDelimited == null || fieldDelimited.isEmpty()) { throw new SerDeException("This table does not have serde property \"field.delim\"!"); } // get the collection separator and map key separator // TODO: use serdeConstants.COLLECTION_DELIM when the typo is fixed collSep = LazyUtils.getByte(tbl.getProperty(COLLECTION_DELIM), DEFAULT_SEPARATORS[1]); keySep = LazyUtils.getByte(tbl.getProperty(serdeConstants.MAPKEY_DELIM), DEFAULT_SEPARATORS[2]); serdeParams.setSeparator(1, collSep); serdeParams.setSeparator(2, keySep); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), serdeParams .getSeparators(), serdeParams.getNullSequence(), serdeParams .isLastColumnTakesRest(), serdeParams.isEscaped(), serdeParams .getEscapeChar()); cachedLazyStruct = (LazyStruct) LazyFactory.createLazyObject(cachedObjectInspector); assert serdeParams.getColumnNames().size() == serdeParams.getColumnTypes().size(); numColumns = serdeParams.getColumnNames().size(); }
@Override public final Object deserialize(Writable blob) throws SerDeException { if (!this.charset.equals(Charsets.UTF_8)) { blob = transformToUTF8(blob); } return doDeserialize(blob); }
@Override public final Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { Writable result = doSerialize(obj, objInspector); if (!this.charset.equals(Charsets.UTF_8)) { result = transformFromUTF8(result); } return result; }
/** * Initialize the SerDe given the parameters. serialization.format: separator * char or byte code (only supports byte-value up to 127) columns: * ","-separated column names columns.types: ",", ":", or ";"-separated column * types * * @see org.apache.hadoop.hive.serde2.AbstractSerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration job, Properties tbl) throws SerDeException { super.initialize(job, tbl); serdeParams = new LazySerDeParameters(job, tbl, getClass().getName()); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), new LazyObjectInspectorParametersImpl(serdeParams)); cachedLazyStruct = (LazyStruct) LazyFactory .createLazyObject(cachedObjectInspector); serializedSize = 0; stats = new SerDeStats(); lastOperationSerialize = false; lastOperationDeserialize = false; }
@Override public final Object deserialize(Writable blob) throws SerDeException { if (!this.charset.equals(Charsets.UTF_8)) { blob = transformToUTF8(blob); } return doDeserialize(blob); }
@Override public final Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { Writable result = doSerialize(obj, objInspector); if (!this.charset.equals(Charsets.UTF_8)) { result = transformFromUTF8(result); } return result; }
/** * Initialize the SerDe given the parameters. serialization.format: separator * char or byte code (only supports byte-value up to 127) columns: * ","-separated column names columns.types: ",", ":", or ";"-separated column * types * * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration job, Properties tbl) throws SerDeException { super.initialize(job, tbl); serdeParams = new LazySerDeParameters(job, tbl, getClass().getName()); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), new LazyObjectInspectorParametersImpl(serdeParams)); cachedLazyStruct = (LazyStruct) LazyFactory .createLazyObject(cachedObjectInspector); LOG.debug(getClass().getName() + " initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString() + " lastColumnTakesRest=" + serdeParams.isLastColumnTakesRest() + " timestampFormats=" + serdeParams.getTimestampFormats()); serializedSize = 0; stats = new SerDeStats(); lastOperationSerialize = false; lastOperationDeserialize = false; }
@Override public final Object deserialize(Writable blob) throws SerDeException { if (!this.charset.equals(Charsets.UTF_8)) { blob = transformToUTF8(blob); } return doDeserialize(blob); }
@Override public final Writable serialize(Object obj, ObjectInspector objInspector) throws SerDeException { Writable result = doSerialize(obj, objInspector); if (!this.charset.equals(Charsets.UTF_8)) { result = transformFromUTF8(result); } return result; }
/** * Initialize the SerDe given the parameters. serialization.format: separator * char or byte code (only supports byte-value up to 127) columns: * ","-separated column names columns.types: ",", ":", or ";"-separated column * types * * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration job, Properties tbl) throws SerDeException { super.initialize(job, tbl); serdeParams = new LazySerDeParameters(job, tbl, getClass().getName()); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), new LazyObjectInspectorParametersImpl(serdeParams)); cachedLazyStruct = (LazyStruct) LazyFactory .createLazyObject(cachedObjectInspector); LOG.debug(getClass().getName() + " initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString() + " lastColumnTakesRest=" + serdeParams.isLastColumnTakesRest() + " timestampFormats=" + serdeParams.getTimestampFormats()); serializedSize = 0; stats = new SerDeStats(); lastOperationSerialize = false; lastOperationDeserialize = false; }
/** * Initialize the SerDe given the parameters. serialization.format: separator * char or byte code (only supports byte-value up to 127) columns: * ","-separated column names columns.types: ",", ":", or ";"-separated column * types * * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration job, Properties tbl) throws SerDeException { super.initialize(job, tbl); serdeParams = new LazySerDeParameters(job, tbl, getClass().getName()); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), new LazyObjectInspectorParametersImpl(serdeParams)); cachedLazyStruct = (LazyStruct) LazyFactory .createLazyObject(cachedObjectInspector); LOG.debug(getClass().getName() + " initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString() + " lastColumnTakesRest=" + serdeParams.isLastColumnTakesRest() + " timestampFormats=" + serdeParams.getTimestampFormats()); serializedSize = 0; stats = new SerDeStats(); lastOperationSerialize = false; lastOperationDeserialize = false; }