deniskuzZ commented on code in PR #6747:
URL: https://github.com/apache/hive/pull/6747#discussion_r3925134702
##########
llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/VectorDeserializeOrcWriter.java:
##########
@@ -103,38 +105,57 @@ public static EncodingWriter create(InputFormat<?, ?>
sourceIf, Deserializer ser
List<Integer> sourceIncludes, boolean[] cacheIncludes, int allocSize,
ExecutorService encodeExecutor)
throws IOException {
// Vector SerDe can be disabled both on client and server side.
+ // MultiDelimitSerDe is accepted alongside LazySimpleSerDe: it's the same
+ // text-row shape, only its top-level FIELD_DELIM can span multiple bytes.
+ // The reader (LazySimpleDeserializeRead) picks the multi-byte scanner
+ // when LazySerDeParameters.setFieldDelimMulti has been called below —
+ // otherwise the specialized single-byte hot loop runs unchanged.
+ final boolean isLazySimple = serDe instanceof LazySimpleSerDe;
+ final boolean isMultiDelim = serDe instanceof MultiDelimitSerDe;
if (!HiveConf.getBoolVar(daemonConf,
ConfVars.LLAP_IO_ENCODE_VECTOR_SERDE_ENABLED)
|| !HiveConf.getBoolVar(jobConf,
ConfVars.LLAP_IO_ENCODE_VECTOR_SERDE_ENABLED)
- || !(sourceIf instanceof TextInputFormat) || !(serDe instanceof
LazySimpleSerDe)) {
+ || !(sourceIf instanceof TextInputFormat) || !(isLazySimple ||
isMultiDelim)) {
return new DeserializerOrcWriter(serDe, sourceOi, allocSize);
}
Path path = splitPath.getFileSystem(jobConf).makeQualified(splitPath);
PartitionDesc partDesc = HiveFileFormatUtils.getFromPathRecursively(parts,
path, null);
if (partDesc == null) {
- LlapIoImpl.LOG.info("Not using VertorDeserializeOrcWriter: no partition
desc for " + path);
+ LlapIoImpl.LOG.info("Not using VectorDeserializeOrcWriter: no partition
desc for " + path);
return new DeserializerOrcWriter(serDe, sourceOi, allocSize);
}
Properties tblProps = partDesc.getTableDesc().getProperties();
if ("true".equalsIgnoreCase(tblProps.getProperty(
serdeConstants.SERIALIZATION_LAST_COLUMN_TAKES_REST))) {
- LlapIoImpl.LOG.info("Not using VertorDeserializeOrcWriter due to "
+ LlapIoImpl.LOG.info("Not using VectorDeserializeOrcWriter due to "
+ serdeConstants.SERIALIZATION_LAST_COLUMN_TAKES_REST);
return new DeserializerOrcWriter(serDe, sourceOi, allocSize);
}
+ // MultiDelimitSerDe's own row parser (LazyStruct.parseMultiDelimit) does
+ // NOT honour escape.delim for the top-level delimiter. Combining a
+ // multi-byte field delim with an escape char in the fast path would let
+ // it silently diverge from the slow path, so bail to DeserializerOrcWriter
+ // whenever both are configured on a MultiDelimit table.
+ if (isMultiDelim && tblProps.getProperty(serdeConstants.ESCAPE_CHAR) !=
null) {
+ LlapIoImpl.LOG.info("Not using VectorDeserializeOrcWriter:
MultiDelimitSerDe with "
+ + serdeConstants.ESCAPE_CHAR + " is not supported by the vectorized
fast path");
+ return new DeserializerOrcWriter(serDe, sourceOi, allocSize);
+ }
for (StructField sf : sourceOi.getAllStructFieldRefs()) {
Category c = sf.getFieldObjectInspector().getCategory();
if (c != Category.PRIMITIVE) {
- LlapIoImpl.LOG.info("Not using VertorDeserializeOrcWriter: " + c + "
is not supported");
+ LlapIoImpl.LOG.info("Not using VectorDeserializeOrcWriter: " + c + "
is not supported");
Review Comment:
warn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]