wecharyu commented on code in PR #4831:
URL: https://github.com/apache/hive/pull/4831#discussion_r1391344638


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -2689,11 +2690,32 @@ private void addPartitionsInternal(String catName, 
String dbName,
     List<MPartition> mParts = new ArrayList<>();
     List<List<MPartitionPrivilege>> mPartPrivilegesList = new ArrayList<>();
     List<List<MPartitionColumnPrivilege>> mPartColPrivilegesList = new 
ArrayList<>();
+    List<MFieldSchema> partitionKeys = table.getPartitionKeys();
+    int[] dateIndices = IntStream.range(0, partitionKeys.size())
+            .filter(i -> 
partitionKeys.get(i).getType().equalsIgnoreCase(ColumnType.DATE_TYPE_NAME))

Review Comment:
   @saihemanth-cloudera After a double thought, we think it's not good to 
change the partition values in `add_partitions`. 
   The original motivation to do it was that the unit test 
`org.apache.hive.hcatalog.pig.AbstractHCatLoaderTest#testDatePartitionPushUp` 
failed after this patch:
   Pig engine add partition values with time data like `dt=2016-07-14 
15%3A10%3A15`, and then the query by dt cast data to 'yyyy-MM-dd' since 
[HIVE-14282](https://issues.apache.org/jira/browse/HIVE-14282), then it could 
not match PART_NAME and return empty result.
   This test will fail in JDO query too if we disable direct sql because JDO 
query also use PART_NAME filter to speed up query.
   
   To solve this issue, we could add more rules to match PART_NAME, that is if 
the partition type is `date`, then we use `PART_NAME like dt=2023-10-10%` 
instead of `PART_NAME = 2023-10-10`.



-- 
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]

Reply via email to