danny0405 commented on code in PR #11501:
URL: https://github.com/apache/hudi/pull/11501#discussion_r1839396636


##########
hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java:
##########
@@ -360,13 +363,22 @@ protected HoodieTimeline getActiveTimeline() {
   }
 
   private Object[] parsePartitionColumnValues(String[] partitionColumns, 
String partitionPath) {
-    Object[] partitionColumnValues = 
doParsePartitionColumnValues(partitionColumns, partitionPath);
-    if (shouldListLazily && partitionColumnValues.length != 
partitionColumns.length) {
-      throw new HoodieException("Failed to parse partition column values from 
the partition-path:"
-          + " likely non-encoded slashes being used in partition column's 
values. You can try to"
-          + " work this around by switching listing mode to eager");
+    HoodieTableConfig tableConfig = metaClient.getTableConfig();
+    Object[] partitionColumnValues;
+    if (null != tableConfig.getKeyGeneratorClassName()
+        && 
tableConfig.getKeyGeneratorClassName().equals(KeyGeneratorType.TIMESTAMP.getClassName())
+        && 
tableConfig.propsMap().get(TimestampKeyGeneratorConfig.TIMESTAMP_TYPE_FIELD.key()).matches("SCALAR|UNIX_TIMESTAMP|EPOCHMILLISECONDS"))
 {
+      // For TIMESTAMP key generator when TYPE is SCALAR, UNIX_TIMESTAMP or 
EPOCHMILLISECONDS,
+      // we couldn't reconstruct initial partition column values from 
partition paths due to lost data after formatting in most cases
+      partitionColumnValues = new Object[partitionColumns.length];

Review Comment:
   > Execution of query like:
   SELECT ... WHERE ts BETWEEN 1078016000 and 1718953003 ...
   will pass an empty result even with passed partition paths as UTF8Strings, 
because we need to deal with initial UNIX_TIMESTAMP values for this filtering.
   
   > Need to think about how to make it work.
   
   It looks like there is no good way to fix this because of the datetime 
string format, either we handle the partition paths from the query predicates 
with the same key generator and use that for pruning or we store the initial 
non-formatted partition values.



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

Reply via email to