separators[0] = getByte(schema.getProperty(FIELD_DELIM, schema.getProperty(SERIALIZATION_FORMAT)), DEFAULT_SEPARATORS[0]); separators[1] = getByte(schema.getProperty(COLLECTION_DELIM), DEFAULT_SEPARATORS[1]); separators[2] = getByte(schema.getProperty(MAPKEY_DELIM), DEFAULT_SEPARATORS[2]); Byte escapeByte = null; if (escapeProperty != null) { escapeByte = getByte(escapeProperty, (byte) '\\');
&& extendAdditionalNestingValue.equalsIgnoreCase("true"); separatorCandidates.add(LazyUtils.getByte(tableProperties.getProperty(serdeConstants.FIELD_DELIM, tableProperties.getProperty(serdeConstants.SERIALIZATION_FORMAT)), DefaultSeparators[0])); separatorCandidates.add(LazyUtils.getByte(tableProperties .getProperty(serdeConstants.COLLECTION_DELIM), DefaultSeparators[1])); separatorCandidates.add(LazyUtils.getByte( tableProperties.getProperty(serdeConstants.MAPKEY_DELIM), DefaultSeparators[2]));
escaped = (escapeProperty != null); if (escaped) { escapeChar = LazyUtils.getByte(escapeProperty, (byte) '\\'); needsEscape[escapeChar & 0xFF] = true; // Converts the negative byte into positive index for (byte b : separators) {
@Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { // get the SerDe parameters super.initialize(conf, tbl); serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); fieldDelimited = tbl.getProperty(serdeConstants.FIELD_DELIM); if (fieldDelimited == null || fieldDelimited.isEmpty()) { throw new SerDeException("This table does not have serde property \"field.delim\"!"); } // get the collection separator and map key separator // TODO: use serdeConstants.COLLECTION_DELIM when the typo is fixed collSep = LazyUtils.getByte(tbl.getProperty(COLLECTION_DELIM), DEFAULT_SEPARATORS[1]); keySep = LazyUtils.getByte(tbl.getProperty(serdeConstants.MAPKEY_DELIM), DEFAULT_SEPARATORS[2]); serdeParams.setSeparator(1, collSep); serdeParams.setSeparator(2, keySep); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), serdeParams .getSeparators(), serdeParams.getNullSequence(), serdeParams .isLastColumnTakesRest(), serdeParams.isEscaped(), serdeParams .getEscapeChar()); cachedLazyStruct = (LazyStruct) LazyFactory.createLazyObject(cachedObjectInspector); assert serdeParams.getColumnNames().size() == serdeParams.getColumnTypes().size(); numColumns = serdeParams.getColumnNames().size(); }
separators[0] = getByte(schema.getProperty(FIELD_DELIM, schema.getProperty(SERIALIZATION_FORMAT)), DEFAULT_SEPARATORS[0]); separators[1] = getByte(schema.getProperty(COLLECTION_DELIM), DEFAULT_SEPARATORS[1]); separators[2] = getByte(schema.getProperty(MAPKEY_DELIM), DEFAULT_SEPARATORS[2]); Byte escapeByte = null; if (escapeProperty != null) { escapeByte = getByte(escapeProperty, (byte) '\\');
&& extendAdditionalNestingValue.equalsIgnoreCase("true"); separatorCandidates.add(LazyUtils.getByte(tableProperties.getProperty(serdeConstants.FIELD_DELIM, tableProperties.getProperty(serdeConstants.SERIALIZATION_FORMAT)), DefaultSeparators[0])); separatorCandidates.add(LazyUtils.getByte(tableProperties .getProperty(serdeConstants.COLLECTION_DELIM), DefaultSeparators[1])); separatorCandidates.add(LazyUtils.getByte( tableProperties.getProperty(serdeConstants.MAPKEY_DELIM), DefaultSeparators[2]));
&& extendAdditionalNestingValue.equalsIgnoreCase("true"); separatorCandidates.add(LazyUtils.getByte(tableProperties.getProperty(serdeConstants.FIELD_DELIM, tableProperties.getProperty(serdeConstants.SERIALIZATION_FORMAT)), DefaultSeparators[0])); separatorCandidates.add(LazyUtils.getByte(tableProperties .getProperty(serdeConstants.COLLECTION_DELIM), DefaultSeparators[1])); separatorCandidates.add(LazyUtils.getByte( tableProperties.getProperty(serdeConstants.MAPKEY_DELIM), DefaultSeparators[2]));
&& extendAdditionalNestingValue.equalsIgnoreCase("true"); separatorCandidates.add(LazyUtils.getByte(tableProperties.getProperty(serdeConstants.FIELD_DELIM, tableProperties.getProperty(serdeConstants.SERIALIZATION_FORMAT)), DefaultSeparators[0])); separatorCandidates.add(LazyUtils.getByte(tableProperties .getProperty(serdeConstants.COLLECTION_DELIM), DefaultSeparators[1])); separatorCandidates.add(LazyUtils.getByte( tableProperties.getProperty(serdeConstants.MAPKEY_DELIM), DefaultSeparators[2]));
&& extendAdditionalNestingValue.equalsIgnoreCase("true"); separatorCandidates.add(LazyUtils.getByte(tableProperties.getProperty(serdeConstants.FIELD_DELIM, tableProperties.getProperty(serdeConstants.SERIALIZATION_FORMAT)), DefaultSeparators[0])); separatorCandidates.add(LazyUtils.getByte(tableProperties .getProperty(serdeConstants.COLLECTION_DELIM), DefaultSeparators[1])); separatorCandidates.add(LazyUtils.getByte( tableProperties.getProperty(serdeConstants.MAPKEY_DELIM), DefaultSeparators[2]));
escaped = (escapeProperty != null); if (escaped) { escapeChar = LazyUtils.getByte(escapeProperty, (byte) '\\'); needsEscape[escapeChar & 0xFF] = true; // Converts the negative byte into positive index for (byte b : separators) {
escaped = (escapeProperty != null); if (escaped) { escapeChar = LazyUtils.getByte(escapeProperty, (byte) '\\'); needsEscape[escapeChar & 0xFF] = true; // Converts the negative byte into positive index for (byte b : separators) {
escaped = (escapeProperty != null); if (escaped) { escapeChar = LazyUtils.getByte(escapeProperty, (byte) '\\'); needsEscape[escapeChar & 0xFF] = true; // Converts the negative byte into positive index for (byte b : separators) {
escaped = (escapeProperty != null); if (escaped) { escapeChar = LazyUtils.getByte(escapeProperty, (byte) '\\'); needsEscape[escapeChar & 0xFF] = true; // Converts the negative byte into positive index for (byte b : separators) {
@Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { // get the SerDe parameters serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); fieldDelimited = tbl.getProperty(serdeConstants.FIELD_DELIM); if (fieldDelimited == null || fieldDelimited.isEmpty()) { throw new SerDeException("This table does not have serde property \"field.delim\"!"); } // get the collection separator and map key separator // TODO: use serdeConstants.COLLECTION_DELIM when the typo is fixed collSep = LazyUtils.getByte(tbl.getProperty(COLLECTION_DELIM), DEFAULT_SEPARATORS[1]); keySep = LazyUtils.getByte(tbl.getProperty(serdeConstants.MAPKEY_DELIM), DEFAULT_SEPARATORS[2]); serdeParams.setSeparator(1, collSep); serdeParams.setSeparator(2, keySep); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), serdeParams .getSeparators(), serdeParams.getNullSequence(), serdeParams .isLastColumnTakesRest(), serdeParams.isEscaped(), serdeParams .getEscapeChar()); cachedLazyStruct = (LazyStruct) LazyFactory.createLazyObject(cachedObjectInspector); assert serdeParams.getColumnNames().size() == serdeParams.getColumnTypes().size(); numColumns = serdeParams.getColumnNames().size(); }
@Override public void initialize(Configuration conf, Properties tbl) throws SerDeException { // get the SerDe parameters serdeParams = new LazySerDeParameters(conf, tbl, getClass().getName()); fieldDelimited = tbl.getProperty(serdeConstants.FIELD_DELIM); if (fieldDelimited == null || fieldDelimited.isEmpty()) { throw new SerDeException("This table does not have serde property \"field.delim\"!"); } // get the collection separator and map key separator // TODO: use serdeConstants.COLLECTION_DELIM when the typo is fixed collSep = LazyUtils.getByte(tbl.getProperty(COLLECTION_DELIM), DEFAULT_SEPARATORS[1]); keySep = LazyUtils.getByte(tbl.getProperty(serdeConstants.MAPKEY_DELIM), DEFAULT_SEPARATORS[2]); serdeParams.setSeparator(1, collSep); serdeParams.setSeparator(2, keySep); // Create the ObjectInspectors for the fields cachedObjectInspector = LazyFactory.createLazyStructInspector(serdeParams .getColumnNames(), serdeParams.getColumnTypes(), serdeParams .getSeparators(), serdeParams.getNullSequence(), serdeParams .isLastColumnTakesRest(), serdeParams.isEscaped(), serdeParams .getEscapeChar()); cachedLazyStruct = (LazyStruct) LazyFactory.createLazyObject(cachedObjectInspector); assert serdeParams.getColumnNames().size() == serdeParams.getColumnTypes().size(); numColumns = serdeParams.getColumnNames().size(); }