/** * Initialize the SerDe given the parameters. * * @see org.apache.hadoop.hive.serde2.AbstractSerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); // Create the ObjectInspectors for the fields. Note: Currently // ColumnarObject uses same ObjectInpector as LazyStruct cachedObjectInspector = LazyFactory.createColumnarStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams); int size = serdeParams.getColumnTypes().size(); List<Integer> notSkipIDs = new ArrayList<Integer>(); if (conf == null || ColumnProjectionUtils.isReadAllColumns(conf)) { for (int i = 0; i < size; i++ ) { notSkipIDs.add(i); } } else { notSkipIDs = ColumnProjectionUtils.getReadColumnIDs(conf); } cachedLazyStruct = new ColumnarStruct( cachedObjectInspector, notSkipIDs, serdeParams.getNullSequence()); super.initialize(size); }
/** * Initialize the SerDe given the parameters. * * @see org.apache.hadoop.hive.serde2.AbstractSerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); // Create the ObjectInspectors for the fields. Note: Currently // ColumnarObject uses same ObjectInpector as LazyStruct cachedObjectInspector = LazyFactory.createColumnarStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams); int size = serdeParams.getColumnTypes().size(); List<Integer> notSkipIDs = new ArrayList<Integer>(); if (conf == null || ColumnProjectionUtils.isReadAllColumns(conf)) { for (int i = 0; i < size; i++ ) { notSkipIDs.add(i); } } else { notSkipIDs = ColumnProjectionUtils.getReadColumnIDs(conf); } cachedLazyStruct = new ColumnarStruct( cachedObjectInspector, notSkipIDs, serdeParams.getNullSequence()); super.initialize(size); }
/** * Initialize the SerDe given the parameters. * * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); // Create the ObjectInspectors for the fields. Note: Currently // ColumnarObject uses same ObjectInpector as LazyStruct cachedObjectInspector = LazyFactory.createColumnarStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams); int size = serdeParams.getColumnTypes().size(); List<Integer> notSkipIDs = new ArrayList<Integer>(); if (conf == null || ColumnProjectionUtils.isReadAllColumns(conf)) { for (int i = 0; i < size; i++ ) { notSkipIDs.add(i); } } else { notSkipIDs = ColumnProjectionUtils.getReadColumnIDs(conf); } cachedLazyStruct = new ColumnarStruct( cachedObjectInspector, notSkipIDs, serdeParams.getNullSequence()); super.initialize(size); LOG.debug("ColumnarSerDe initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString()); }
/** * Initialize the SerDe given the parameters. * * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); // Create the ObjectInspectors for the fields. Note: Currently // ColumnarObject uses same ObjectInpector as LazyStruct cachedObjectInspector = LazyFactory.createColumnarStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams); int size = serdeParams.getColumnTypes().size(); List<Integer> notSkipIDs = new ArrayList<Integer>(); if (conf == null || ColumnProjectionUtils.isReadAllColumns(conf)) { for (int i = 0; i < size; i++ ) { notSkipIDs.add(i); } } else { notSkipIDs = ColumnProjectionUtils.getReadColumnIDs(conf); } cachedLazyStruct = new ColumnarStruct( cachedObjectInspector, notSkipIDs, serdeParams.getNullSequence()); super.initialize(size); LOG.debug("ColumnarSerDe initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString()); }
/** * Initialize the SerDe given the parameters. * * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); // Create the ObjectInspectors for the fields. Note: Currently // ColumnarObject uses same ObjectInpector as LazyStruct cachedObjectInspector = LazyFactory.createColumnarStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams); int size = serdeParams.getColumnTypes().size(); List<Integer> notSkipIDs = new ArrayList<Integer>(); if (conf == null || ColumnProjectionUtils.isReadAllColumns(conf)) { for (int i = 0; i < size; i++ ) { notSkipIDs.add(i); } } else { notSkipIDs = ColumnProjectionUtils.getReadColumnIDs(conf); } cachedLazyStruct = new ColumnarStruct( cachedObjectInspector, notSkipIDs, serdeParams.getNullSequence()); super.initialize(size); LOG.debug("ColumnarSerDe initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString()); }
/** * Initialize the SerDe given the parameters. * * @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. Note: Currently // ColumnarObject uses same ObjectInpector as LazyStruct cachedObjectInspector = LazyFactory.createColumnarStructInspector( serdeParams.getColumnNames(), serdeParams.getColumnTypes(), serdeParams .getSeparators(), serdeParams.getNullSequence(), serdeParams .isEscaped(), serdeParams.getEscapeChar()); java.util.ArrayList<Integer> notSkipIDs = ColumnProjectionUtils.getReadColumnIDs(job); cachedLazyStruct = new ColumnarStruct(cachedObjectInspector, notSkipIDs, serdeParams.getNullSequence()); int size = serdeParams.getColumnTypes().size(); field = new BytesRefWritable[size]; for (int i = 0; i < size; i++) { field[i] = new BytesRefWritable(); serializeCache.set(i, field[i]); } LOG.debug("ColumnarSerDe initialized with: columnNames=" + serdeParams.getColumnNames() + " columnTypes=" + serdeParams.getColumnTypes() + " separator=" + Arrays.asList(serdeParams.getSeparators()) + " nullstring=" + serdeParams.getNullString()); }