difin commented on code in PR #5123:
URL: https://github.com/apache/hive/pull/5123#discussion_r1571193903
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -8815,6 +8815,23 @@ These props are now enabled elsewhere (see commit
diffs). It would be better in
conf.set(AcidUtils.CONF_ACID_KEY, "true");
SessionState.get().getConf().set(AcidUtils.CONF_ACID_KEY, "true");
}
+
+ private void validateColumnCounts(String dest, Table table, Map<String,
String> partitionSpec,
+ int inColumnCnt, int outColumnCnt) throws SemanticException {
+
+ long staticPartitionColumnCnt = partitionSpec != null ?
+ partitionSpec.values().stream().filter(Objects::nonNull).count() : 0;
+
+ if (inColumnCnt + staticPartitionColumnCnt != outColumnCnt &&
Review Comment:
Extracted the code into a local var, but about the second part,
unfortunately it won't work because I saw that for Iceberg in some cases
(q-tests) it can be `inColumnCnt + staticPartitionColumnCnt == outColumnCnt`
and in other cases ` inColumnCnt == outColumnCnt` and the suggested expression
won't cover the first case.
Would you accept this instead?
```
if (inColumnCnt + staticPartitionColumnCnt != outColumnCnt &&
((alwaysUnpartitioned && inColumnCnt != outColumnCnt) ||
!alwaysUnpartitioned)) {
...
}
```
--
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]