/** * Create the {@link LazyObjectBase lazy field} * */ public static LazyObjectBase createLazyField(ColumnMapping[] columnMappings, int fieldID, ObjectInspector inspector) { ColumnMapping colMap = columnMappings[fieldID]; if (colMap.getQualifierName() == null && !colMap.isHbaseRowKey()) { // a column family return new LazyHBaseCellMap((LazyMapObjectInspector) inspector); } return LazyFactory.createLazyObject(inspector, colMap.getBinaryStorage().get(0)); }
new byte[]{(byte) 1, (byte) 2}, 0, nullSequence, false, (byte) 0); LazyHBaseCellMap b = new LazyHBaseCellMap((LazyMapObjectInspector) oi);
new byte[]{(byte)1, (byte)2}, 0, nullSequence, false, (byte)0); LazyHBaseCellMap b = new LazyHBaseCellMap((LazyMapObjectInspector) oi);
new byte[]{(byte)'#', (byte)'\t'}, 0, nullSequence, false, (byte)0); LazyHBaseCellMap b = new LazyHBaseCellMap((LazyMapObjectInspector) oi);
ObjectInspector oi = LazyFactory.createLazyObjectInspector( mapBinaryIntKeyValue, new byte [] {(byte)1, (byte) 2}, 0, nullSequence, false, (byte) 0); LazyHBaseCellMap hbaseCellMap = new LazyHBaseCellMap((LazyMapObjectInspector) oi); oi = LazyFactory.createLazyObjectInspector( mapBinaryByteKeyValue, new byte [] {(byte) 1, (byte) 2}, 0, nullSequence, false, (byte) 0); hbaseCellMap = new LazyHBaseCellMap((LazyMapObjectInspector) oi); byte [] cfByte = "cf-byte".getBytes(); kvs.clear(); oi = LazyFactory.createLazyObjectInspector( mapBinaryShortKeyValue, new byte [] {(byte) 1, (byte) 2}, 0, nullSequence, false, (byte) 0); hbaseCellMap = new LazyHBaseCellMap((LazyMapObjectInspector) oi); byte [] cfShort = "cf-short".getBytes(); kvs.clear(); oi = LazyFactory.createLazyObjectInspector( mapBinaryLongKeyValue, new byte [] {(byte) 1, (byte) 2}, 0, nullSequence, false, (byte) 0); hbaseCellMap = new LazyHBaseCellMap((LazyMapObjectInspector) oi); byte [] cfLong = "cf-long".getBytes(); kvs.clear(); mapBinaryFloatKeyValue, new byte [] {(byte) 1, (byte) 2}, 0, nullSequence, false, (byte) 0); hbaseCellMap = new LazyHBaseCellMap((LazyMapObjectInspector) oi); byte [] cfFloat = "cf-float".getBytes(); kvs.clear(); mapBinaryDoubleKeyValue, new byte [] {(byte) 1, (byte) 2}, 0, nullSequence, false,
/** * Create the {@link LazyObjectBase lazy field} * */ public static LazyObjectBase createLazyField(ColumnMapping[] columnMappings, int fieldID, ObjectInspector inspector) { ColumnMapping colMap = columnMappings[fieldID]; if (colMap.getQualifierName() == null && !colMap.isHbaseRowKey()) { // a column family return new LazyHBaseCellMap((LazyMapObjectInspector) inspector); } return LazyFactory.createLazyObject(inspector, colMap.getBinaryStorage().get(0)); }
/** * Parse the Result and fill each field. * @see LazyStruct#parse() */ private void parse() { if (getFields() == null) { List<? extends StructField> fieldRefs = ((StructObjectInspector)getInspector()).getAllStructFieldRefs(); LazyObject<? extends ObjectInspector> [] fields = new LazyObject<?>[fieldRefs.size()]; for (int i = 0; i < fields.length; i++) { ColumnMapping colMap = columnsMapping.get(i); if (colMap.qualifierName == null && !colMap.hbaseRowKey) { // a column family fields[i] = new LazyHBaseCellMap( (LazyMapObjectInspector) fieldRefs.get(i).getFieldObjectInspector()); continue; } fields[i] = LazyFactory.createLazyObject( fieldRefs.get(i).getFieldObjectInspector(), colMap.binaryStorage.get(0)); } setFields(fields); setFieldInited(new boolean[fields.length]); } Arrays.fill(getFieldInited(), false); setParsed(true); }