ramitg254 commented on code in PR #6658:
URL: https://github.com/apache/hive/pull/6658#discussion_r3778650184
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/add/AlterViewAddPartitionAnalyzer.java:
##########
@@ -79,10 +89,10 @@ protected void postProcess(TableName tableName, Table
table, AlterTableAddPartit
} else {
where.append(" AND ");
}
+ FieldSchema partCol = table.getColumnByName(entry.getKey());
Review Comment:
yes this is working but intentionally went with `getColumnByName` because it
is in general faster than `getPartColByName` as it index all columns
(including data cols and partition keys) once and return fieldschema directly
later rather than `getPartColByName` which streams over entire part cols list
every time we retrieve a fieldschema also it takes care of `nonNative` scenario
as well
https://github.com/apache/hive/blob/2e3b575842bd207c9a692ff95f0013c595b7b65c/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java#L779,
I know semantically it makes more sense to use `getPartColByName` but
because of above reasoning and since this is part of post process so we won't
need to worry about the validation for keys from `getPartSpec()`, I went with
this
--
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]