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


##########
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:
   As I mentioned in comment:
   
https://github.com/apache/hudi/blob/41816e30041b82da7505c8c18288cf4f5df4e00a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestSparkSqlWithTimestampKeyGenerator.scala#L88-L89
   we need to support `shouldExtractPartitionValuesFromPartitionPath` as 
`false` in this case, and process correspondingly. We shouldn't do any 
partition pruning in this case, and retrieving all data for `ts` column from 
data files.
   
   There is some progress with `shouldExtractPartitionValuesFromPartitionPath` 
in https://github.com/apache/hudi/pull/11770, but Jon wrote, that pruning is 
still not fixed:
   
https://github.com/apache/hudi/pull/11770/files#diff-96c57b7af6bc51184f738fcad26b2b966e5f899a3a9eaf1d99dfd5d09dc301fcR92
   



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