/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) throws SerDeException { return createLazyStructInspector(columnNames, typeInfos, separators, nullSequence, lastColumnTakesRest, escaped, escapeChar, false); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @param extendedBooleanLiteral whether extended boolean literal set is legal * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar, boolean extendedBooleanLiteral) throws SerDeException { LazyObjectInspectorParametersImpl lazyParams = new LazyObjectInspectorParametersImpl( escaped, escapeChar, extendedBooleanLiteral, null, separators, nullSequence, lastColumnTakesRest); return createLazyStructInspector(columnNames, typeInfos, lazyParams); }
@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(); }
/** * 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; }
ObjectInspector oi = LazyFactory.createLazyStructInspector( fieldNames, fieldTypeInfos,
ObjectInspector oi = LazyFactory.createLazyStructInspector(fieldNames, fieldTypeInfos, new byte[] {' ', ':', '='}, nullSequence, false, false, (byte)0);
LazyFactory.createLazyStructInspector(fieldNames, fieldTypeInfos, new byte [] {' ', ':', '='}, nullSequence, false, false, (byte) 0);
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) throws SerDeException { return createLazyStructInspector(columnNames, typeInfos, separators, nullSequence, lastColumnTakesRest, escaped, escapeChar, false); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) throws SerDeException { return createLazyStructInspector(columnNames, typeInfos, separators, nullSequence, lastColumnTakesRest, escaped, escapeChar, false); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) throws SerDeException { return createLazyStructInspector(columnNames, typeInfos, separators, nullSequence, lastColumnTakesRest, escaped, escapeChar, false); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar) throws SerDeException { return createLazyStructInspector(columnNames, typeInfos, separators, nullSequence, lastColumnTakesRest, escaped, escapeChar, false); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @param extendedBooleanLiteral whether extended boolean literal set is legal * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar, boolean extendedBooleanLiteral) throws SerDeException { LazyObjectInspectorParametersImpl lazyParams = new LazyObjectInspectorParametersImpl( escaped, escapeChar, extendedBooleanLiteral, null, separators, nullSequence, lastColumnTakesRest); return createLazyStructInspector(columnNames, typeInfos, lazyParams); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @param extendedBooleanLiteral whether extended boolean literal set is legal * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar, boolean extendedBooleanLiteral) throws SerDeException { LazyObjectInspectorParametersImpl lazyParams = new LazyObjectInspectorParametersImpl( escaped, escapeChar, extendedBooleanLiteral, null, separators, nullSequence, lastColumnTakesRest); return createLazyStructInspector(columnNames, typeInfos, lazyParams); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @param extendedBooleanLiteral whether extended boolean literal set is legal * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar, boolean extendedBooleanLiteral) throws SerDeException { LazyObjectInspectorParametersImpl lazyParams = new LazyObjectInspectorParametersImpl( escaped, escapeChar, extendedBooleanLiteral, null, separators, nullSequence, lastColumnTakesRest); return createLazyStructInspector(columnNames, typeInfos, lazyParams); }
/** * Create a hierarchical ObjectInspector for LazyStruct with the given * columnNames and columnTypeInfos. * * @param lastColumnTakesRest * whether the last column of the struct should take the rest of the * row if there are extra fields. * @param extendedBooleanLiteral whether extended boolean literal set is legal * @throws SerDeException * @see LazyFactory#createLazyObjectInspector(TypeInfo, byte[], int, Text, * boolean, byte) */ @Deprecated public static ObjectInspector createLazyStructInspector( List<String> columnNames, List<TypeInfo> typeInfos, byte[] separators, Text nullSequence, boolean lastColumnTakesRest, boolean escaped, byte escapeChar, boolean extendedBooleanLiteral) throws SerDeException { LazyObjectInspectorParametersImpl lazyParams = new LazyObjectInspectorParametersImpl( escaped, escapeChar, extendedBooleanLiteral, null, separators, nullSequence, lastColumnTakesRest); return createLazyStructInspector(columnNames, typeInfos, lazyParams); }
/** * 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) */ public void initialize(Configuration job, Properties tbl) throws SerDeException { serdeParams = LazySimpleSerDe.initSerdeParams(job, tbl, getClass() .getName()); // 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); LOG.debug(getClass().getName() + " initialized with: columnNames=" + serdeParams.columnNames + " columnTypes=" + serdeParams.columnTypes + " separator=" + Arrays.asList(serdeParams.separators) + " nullstring=" + serdeParams.nullString + " lastColumnTakesRest=" + serdeParams.lastColumnTakesRest); }
/** * 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 void initialize(Configuration conf, Properties tbl) throws SerDeException { // get the SerDe parameters 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 void initialize(Configuration conf, Properties tbl) throws SerDeException { // get the SerDe parameters 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(); }
/** * Initialize the SerDe given parameters. * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { initHBaseSerDeParameters(conf, tbl, getClass().getName()); cachedObjectInspector = LazyFactory.createLazyStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams.getSeparators(), serdeParams.getNullSequence(), serdeParams.isLastColumnTakesRest(), serdeParams.isEscaped(), serdeParams.getEscapeChar()); cachedHBaseRow = new LazyHBaseRow( (LazySimpleStructObjectInspector) cachedObjectInspector); if (LOG.isDebugEnabled()) { LOG.debug("HBaseSerDe initialized with : columnNames = " + serdeParams.getColumnNames() + " columnTypes = " + serdeParams.getColumnTypes() + " hbaseColumnMapping = " + hbaseColumnsMapping); } }