public static ObjectInspector createLazyHBaseStructInspector( LazySerDeParameters serdeParams, int index, HBaseKeyFactory keyFactory, List<HBaseValueFactory> valueFactories) throws SerDeException { List<TypeInfo> columnTypes = serdeParams.getColumnTypes(); ArrayList<ObjectInspector> columnObjectInspectors = new ArrayList<ObjectInspector>( columnTypes.size()); for (int i = 0; i < columnTypes.size(); i++) { if (i == index) { columnObjectInspectors.add(keyFactory.createKeyObjectInspector(columnTypes.get(i))); } else { columnObjectInspectors.add(valueFactories.get(i).createValueObjectInspector( columnTypes.get(i))); } } return LazyObjectInspectorFactory.getLazySimpleStructObjectInspector( serdeParams.getColumnNames(), columnObjectInspectors, null, serdeParams.getSeparators()[0], serdeParams, ObjectInspectorOptions.JAVA); }
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 static ObjectInspector createLazyHBaseStructInspector( LazySerDeParameters serdeParams, int index, HBaseKeyFactory keyFactory, List<HBaseValueFactory> valueFactories) throws SerDeException { List<TypeInfo> columnTypes = serdeParams.getColumnTypes(); ArrayList<ObjectInspector> columnObjectInspectors = new ArrayList<ObjectInspector>( columnTypes.size()); for (int i = 0; i < columnTypes.size(); i++) { if (i == index) { columnObjectInspectors.add(keyFactory.createKeyObjectInspector(columnTypes.get(i))); } else { columnObjectInspectors.add(valueFactories.get(i).createValueObjectInspector( columnTypes.get(i))); } } return LazyObjectInspectorFactory.getLazySimpleStructObjectInspector( serdeParams.getColumnNames(), columnObjectInspectors, null, serdeParams.getSeparators()[0], serdeParams, ObjectInspectorOptions.JAVA); } }