deniskuzZ commented on code in PR #6413:
URL: https://github.com/apache/hive/pull/6413#discussion_r3396326903
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsAutoGatherContext.java:
##########
@@ -274,50 +276,71 @@ private void replaceSelectOperatorProcess(SelectOperator
operator, Operator<? ex
columnExprMap.put(internalName, exprNodeDesc);
signature.add(selRSSig.get(selRSIdx));
}
+ int dynPartsCount=0;
+ if (partSpec != null) {
+ for (Map.Entry<String, String> entry : partSpec.entrySet()) {
+ if (entry.getValue() == null) {
+ dynPartsCount++;
+ }
+ }
+ }
+ boolean inputRRHasStaticParts = (this.columns.size() + dynPartsCount <
columns.size());
// if there is any partition column (in static partition or dynamic
// partition or mixed case)
- int dynamicPartBegin = -1;
+ int dynamicPartBegin = 0;
Review Comment:
like this?
````
if (isStaticPartition) {
if (inputRRHasStaticParts) {
// non-native (e.g. Iceberg): the partition column is a real column in
the input row, resolved by
// name, so the static-before-dynamic ordering constraint does not apply.
exprNodeDesc = new ExprNodeColumnDesc(columns.get(tableIndex -
staticPartShift));
} else {
// native: the static partition value is a constant, not present in the
input row. The row layout
// drops static columns, so a static column may not follow a dynamic one.
if (dynamicPartSeen) {
throw new SemanticException(
"Dynamic partition columns should not come before static partition
columns.");
}
exprNodeDesc = new ExprNodeConstantDesc(partSpec.get(partColName));
staticPartShift++;
}
}
````
--
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]