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

[PR] [core]Fix modify tag period exception [incubator-paimon]

MonsterChenzhuo opened a new pull request, #2275:
URL: https://github.com/apache/incubator-paimon/pull/2275

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   Fix modify tag period exception.
   <img width="1044" alt="企业微信截图_067933cf-b106-4862-925a-0cc16eae5f26" src="https://github.com/apache/incubator-paimon/assets/60029759/05f2cbbf-d629-4783-b823-64a6edb20cb4"
   
   <!-- 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]Fix modify tag period exception [incubator-paimon]

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


-- 
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]Fix modify tag period exception [incubator-paimon]

Posted by "yuzelin (via GitHub)" <gi...@apache.org>.
yuzelin commented on code in PR #2275:
URL: https://github.com/apache/incubator-paimon/pull/2275#discussion_r1384574668


##########
paimon-core/src/main/java/org/apache/paimon/tag/TagAutoCreation.java:
##########
@@ -74,8 +74,13 @@ private TagAutoCreation(
         } else {
             Snapshot lastTag = tags.lastKey();
             this.nextSnapshot = lastTag.id() + 1;
-
-            LocalDateTime time = periodHandler.tagToTime(tags.get(lastTag));
+            LocalDateTime time;
+            String lastTagValue = tags.get(lastTag);
+            if (periodHandler instanceof TagPeriodHandler.DailyTagPeriodHandler) {
+                time = periodHandler.tagToTime(lastTagValue.split(" ")[0]);
+            } else {
+                time = periodHandler.tagToTime(lastTagValue);
+            }

Review Comment:
   You can just place the `split` logic into `DailyTagPeriodHandler#tagToTime`.



-- 
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]Fix modify tag period exception [incubator-paimon]

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #2275:
URL: https://github.com/apache/incubator-paimon/pull/2275#discussion_r1384632899


##########
paimon-core/src/main/java/org/apache/paimon/tag/TagAutoCreation.java:
##########
@@ -74,8 +74,13 @@ private TagAutoCreation(
         } else {
             Snapshot lastTag = tags.lastKey();
             this.nextSnapshot = lastTag.id() + 1;
-
-            LocalDateTime time = periodHandler.tagToTime(tags.get(lastTag));
+            LocalDateTime time;
+            String lastTagValue = tags.get(lastTag);
+            if (periodHandler instanceof TagPeriodHandler.DailyTagPeriodHandler) {
+                time = periodHandler.tagToTime(lastTagValue.split(" ")[0]);
+            } else {
+                time = periodHandler.tagToTime(lastTagValue);
+            }

Review Comment:
   done.



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