ColumnMapping columnMapping = new ColumnMapping(); ColumnMapping columnMapping = new ColumnMapping(); columnMapping.familyName = HBaseSerDe.HBASE_KEY_COL; columnMapping.familyNameBytes = Bytes.toBytes(HBaseSerDe.HBASE_KEY_COL);
/** * 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)); }
&& colMap.isCategory(ObjectInspector.Category.PRIMITIVE)) {
ColumnMapping columnMapping = new ColumnMapping(); ColumnMapping columnMapping = new ColumnMapping(); columnMapping.familyName = HBaseSerDe.HBASE_KEY_COL; columnMapping.familyNameBytes = Bytes.toBytes(HBaseSerDe.HBASE_KEY_COL);
&& colMap.isCategory(ObjectInspector.Category.PRIMITIVE)) {
ColumnMapping tsMapping = hBaseSerDe.getHBaseSerdeParam().getTimestampColumnMapping(); IndexPredicateAnalyzer analyzer = HiveHBaseTableInputFormat.newIndexPredicateAnalyzer( keyMapping.columnName, keyMapping.isComparable(), tsMapping == null ? null : tsMapping.columnName); List<IndexSearchCondition> conditions = new ArrayList<IndexSearchCondition>();
if (!colMap.isCategory(PrimitiveCategory.TIMESTAMP) && !colMap.isCategory(PrimitiveCategory.LONG)) { throw new SerDeException(serdeName + ": timestamp columns should be of " + "timestamp or bigint type, but is mapped to " + typeInfo.getTypeName());
byte[] serializeKeyField(Object keyValue, StructField keyField, ColumnMapping keyMapping) throws IOException { if (keyValue == null) { throw new IOException("HBase row key cannot be NULL"); } ObjectInspector keyFieldOI = keyField.getFieldObjectInspector(); if (!keyFieldOI.getCategory().equals(ObjectInspector.Category.PRIMITIVE) && keyMapping.isCategory(ObjectInspector.Category.PRIMITIVE)) { // we always serialize the String type using the escaped algorithm for LazyString return serialize(SerDeUtils.getJSONString(keyValue, keyFieldOI), PrimitiveObjectInspectorFactory.javaStringObjectInspector, 1, false); } // use the serialization option switch to write primitive values as either a variable // length UTF8 string or a fixed width bytes if serializing in binary format boolean writeBinary = keyMapping.binaryStorage.get(0); return serialize(keyValue, keyFieldOI, 1, writeBinary); }
public boolean isComparable() { return binaryStorage.get(0) || isCategory(PrimitiveCategory.STRING); } }
/** * 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)); }
ColumnMapping tsMapping = hBaseSerDe.getHBaseSerdeParam().getTimestampColumnMapping(); IndexPredicateAnalyzer analyzer = HiveHBaseTableInputFormat.newIndexPredicateAnalyzer( keyMapping.columnName, keyMapping.isComparable(), tsMapping == null ? null : tsMapping.columnName); List<IndexSearchCondition> conditions = new ArrayList<IndexSearchCondition>();
result, colMap.familyNameBytes, colMap.binaryStorage, colMap.qualifierPrefixBytes, colMap.isDoPrefixCut()); return fields[fieldID].getObject();
if (!colMap.isCategory(PrimitiveCategory.TIMESTAMP) && !colMap.isCategory(PrimitiveCategory.LONG)) { throw new SerDeException(serdeName + ": timestamp columns should be of " + "timestamp or bigint type, but is mapped to " + typeInfo.getTypeName());
byte[] serializeKeyField(Object keyValue, StructField keyField, ColumnMapping keyMapping) throws IOException { if (keyValue == null) { throw new IOException("HBase row key cannot be NULL"); } ObjectInspector keyFieldOI = keyField.getFieldObjectInspector(); if (!keyFieldOI.getCategory().equals(ObjectInspector.Category.PRIMITIVE) && keyMapping.isCategory(ObjectInspector.Category.PRIMITIVE)) { // we always serialize the String type using the escaped algorithm for LazyString return serialize(SerDeUtils.getJSONString(keyValue, keyFieldOI), PrimitiveObjectInspectorFactory.javaStringObjectInspector, 1, false); } // use the serialization option switch to write primitive values as either a variable // length UTF8 string or a fixed width bytes if serializing in binary format boolean writeBinary = keyMapping.binaryStorage.get(0); return serialize(keyValue, keyFieldOI, 1, writeBinary); }
public boolean isComparable() { return binaryStorage.get(0) || isCategory(PrimitiveCategory.STRING); } }