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


##########
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:
   This config `HIVE_TYPE_CHECK_ON_INSERT` seems a client conf to correct the 
user input.
   
   The reason why we want to check `date` value format is that HMS query `date` 
value in format of `uuuu-MM-dd` strictly:
   
https://github.com/apache/hive/blob/5e6ce2a66404ef0267c27f407f14e601e566dfc0/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java#L1368-L1371
   And many engines like Spark will guarantee the  `date` value in format of 
`uuuu-MM-dd`, which is also important when use date related udf on such 
partition column.



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