public LazySerDeParameters getSerdeParams() { return serdeParams.getSerdeParams(); }
@Override public void init(HBaseSerDeParameters hbaseParams, Configuration conf, Properties properties) throws SerDeException { this.hbaseParams = hbaseParams; this.serdeParams = hbaseParams.getSerdeParams(); this.columnMappings = hbaseParams.getColumnMappings(); this.properties = properties; this.conf = conf; }
@Override public void init(HBaseSerDeParameters hbaseParam, Properties properties) throws SerDeException { super.init(hbaseParam, properties); this.serdeParams = hbaseParam.getSerdeParams(); this.serializer = new HBaseRowSerializer(hbaseParam); }
public static ObjectInspector createLazyHBaseStructInspector(HBaseSerDeParameters hSerdeParams, Properties tbl) throws SerDeException { List<TypeInfo> columnTypes = hSerdeParams.getColumnTypes(); ArrayList<ObjectInspector> columnObjectInspectors = new ArrayList<ObjectInspector>( columnTypes.size()); for (int i = 0; i < columnTypes.size(); i++) { if (i == hSerdeParams.getKeyIndex()) { columnObjectInspectors.add(hSerdeParams.getKeyFactory() .createKeyObjectInspector(columnTypes.get(i))); } else { columnObjectInspectors.add(hSerdeParams.getValueFactories().get(i) .createValueObjectInspector(columnTypes.get(i))); } } List<String> structFieldComments = StringUtils.isEmpty(tbl.getProperty("columns.comments")) ? new ArrayList<>(Collections.nCopies(columnTypes.size(), "")) : Arrays.asList(tbl.getProperty("columns.comments").split("\0", columnTypes.size())); return LazyObjectInspectorFactory.getLazySimpleStructObjectInspector( hSerdeParams.getColumnNames(), columnObjectInspectors, structFieldComments, hSerdeParams.getSerdeParams().getSeparators()[0], hSerdeParams.getSerdeParams(), ObjectInspectorOptions.JAVA); } }
public HBaseRowSerializer(HBaseSerDeParameters hbaseParam) { this.hbaseParam = hbaseParam; this.keyFactory = hbaseParam.getKeyFactory(); this.serdeParam = hbaseParam.getSerdeParams(); this.separators = serdeParam.getSeparators(); this.escaped = serdeParam.isEscaped(); this.escapeChar = serdeParam.getEscapeChar(); this.needsEscape = serdeParam.getNeedsEscape(); this.keyIndex = hbaseParam.getKeyIndex(); this.timestampIndex = hbaseParam.getTimestampIndex(); this.columnMappings = hbaseParam.getColumnMappings().getColumnsMapping(); this.keyMapping = hbaseParam.getColumnMappings().getKeyMapping(); this.timestampMapping = hbaseParam.getColumnMappings().getTimestampMapping(); this.putTimestamp = hbaseParam.getPutTimestamp(); }
public LazySerDeParameters getSerdeParams() { return serdeParams.getSerdeParams(); }
@Override public void init(HBaseSerDeParameters hbaseParams, Configuration conf, Properties properties) throws SerDeException { this.hbaseParams = hbaseParams; this.serdeParams = hbaseParams.getSerdeParams(); this.columnMappings = hbaseParams.getColumnMappings(); this.properties = properties; this.conf = conf; }
@Override public void init(HBaseSerDeParameters hbaseParam, Properties properties) throws SerDeException { super.init(hbaseParam, properties); this.serdeParams = hbaseParam.getSerdeParams(); this.serializer = new HBaseRowSerializer(hbaseParam); }
/** * Initialize the SerDe given parameters. * @see SerDe#initialize(Configuration, Properties) */ @Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { serdeParams = new HBaseSerDeParameters(conf, tbl, getClass().getName()); cachedObjectInspector = HBaseLazyObjectFactory .createLazyHBaseStructInspector(serdeParams.getSerdeParams(), serdeParams.getKeyIndex(), serdeParams.getKeyFactory(), serdeParams.getValueFactories()); cachedHBaseRow = new LazyHBaseRow( (LazySimpleStructObjectInspector) cachedObjectInspector, serdeParams); serializer = new HBaseRowSerializer(serdeParams); if (LOG.isDebugEnabled()) { LOG.debug("HBaseSerDe initialized with : " + serdeParams); } }
public HBaseRowSerializer(HBaseSerDeParameters hbaseParam) { this.hbaseParam = hbaseParam; this.keyFactory = hbaseParam.getKeyFactory(); this.serdeParam = hbaseParam.getSerdeParams(); this.separators = serdeParam.getSeparators(); this.escaped = serdeParam.isEscaped(); this.escapeChar = serdeParam.getEscapeChar(); this.needsEscape = serdeParam.getNeedsEscape(); this.keyIndex = hbaseParam.getKeyIndex(); this.timestampIndex = hbaseParam.getTimestampIndex(); this.columnMappings = hbaseParam.getColumnMappings().getColumnsMapping(); this.keyMapping = hbaseParam.getColumnMappings().getKeyMapping(); this.timestampMapping = hbaseParam.getColumnMappings().getTimestampMapping(); this.putTimestamp = hbaseParam.getPutTimestamp(); }