You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "yuzelin (via GitHub)" <gi...@apache.org> on 2024/07/24 06:24:38 UTC

[PR] [core] Refactor exception handling of PartitionTimeExtractor [paimon]

yuzelin opened a new pull request, #3806:
URL: https://github.com/apache/paimon/pull/3806

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   When using `partition markdone`, if some partition is non-date formatted, currently `PartitionTimeExtractor` will return `null` and omit the exception. This PR refactor it for better trouble shooting.
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Refactor exception handling of PartitionTimeExtractor [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #3806:
URL: https://github.com/apache/paimon/pull/3806


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core] Refactor exception handling of PartitionTimeExtractor [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #3806:
URL: https://github.com/apache/paimon/pull/3806#discussion_r1689379527


##########
paimon-core/src/main/java/org/apache/paimon/partition/PartitionTimeExtractor.java:
##########
@@ -112,22 +107,31 @@ public LocalDateTime extract(List<String> partitionKeys, List<?> partitionValues
                                     partitionValues.get(i).toString());
                 }
             }
-            dateTime = toLocalDateTime(timestampString, this.formatter);
+            return toLocalDateTime(timestampString, this.formatter);
         } catch (Exception e) {
             String partitionInfos =
                     IntStream.range(0, partitionKeys.size())
                             .mapToObj(i -> partitionKeys.get(i) + ":" + partitionValues.get(i))
                             .collect(Collectors.joining(","));
-            LOG.warn(
-                    "Partition {} can't uses '{}' formatter to extract datetime to expire."
-                            + " Please check the partition expiration configuration or"
-                            + " manually delete the partition using the drop-partition command or"
-                            + " use 'update-time' expiration strategy by set {}, the strategy support non-date formatted partition.",
-                    partitionInfos,
-                    this.formatter,
-                    CoreOptions.PARTITION_EXPIRATION_STRATEGY.key());
+            String message =
+                    String.format(
+                            "Can't extract datetime from partition '%s' with formatter '%s' and pattern '%s'.",
+                            partitionInfos, this.formatter, this.pattern);
+            if (ignoreException) {
+                LOG.warn(

Review Comment:
   Move this to partition expire.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org