deniskuzZ commented on code in PR #5890:
URL: https://github.com/apache/hive/pull/5890#discussion_r2163220808
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdatePart.java:
##########
@@ -1254,19 +1159,17 @@ public List<Void> run(List<Long> input) throws
Exception {
List<FieldSchema> newCols = sdIdToNewColumns.get(sdId);
// Use the new column descriptor only if the old column descriptor
differs from the new one.
- if (oldCols == null || !oldCols.equals(newCols)) {
- if (oldCols != null && newCols != null) {
- Long newCdId = getDataStoreId(MColumnDescriptor.class);
- newCdIds.add(newCdId);
- newCdIdToCols.put(newCdId, newCols);
- oldCdIdToNewCdId.put(cdId, newCdId);
- sdIdToNewCdId.put(sdId, newCdId);
- for (int i = 0; i < oldCols.size(); i++) {
- FieldSchema oldCol = oldCols.get(i);
- int newIdx = newCols.indexOf(oldCol);
- if (newIdx != -1) {
- oldCdIdToColIdxPairs.computeIfAbsent(cdId, k -> new
ArrayList<>()).add(Pair.of(i, newIdx));
- }
+ if (!oldCols.equals(newCols) && newCols != null) {
Review Comment:
is that safe, won't we get NullPointer when oldCols == null?
--
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]