You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "herefree (via GitHub)" <gi...@apache.org> on 2025/01/05 15:44:20 UTC

[PR] [core] Fix retract behavior for FieldProductAgg [paimon]

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

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   Fix retract behavior for FieldProductAgg.If a null ProductAgg field receives retract message, return a 1/retract value.
   <!-- Linking this pull request to the issue -->
   Linked issue: close #xxx
   
   <!-- 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 retract behavior for FieldProductAgg [paimon]

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


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldProductAgg.java:
##########
@@ -89,7 +89,7 @@ public Object retract(Object accumulator, Object inputField) {
         Object product;
 
         if (accumulator == null || inputField == null) {
-            product = (accumulator == null ? inputField : accumulator);
+            product = (accumulator == null ? inverse(inputField) : accumulator);

Review Comment:
   I prefer to return null here. Return 0 will lead to following value all equals to 0.



-- 
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 retract behavior for FieldProductAgg [paimon]

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


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/aggregate/FieldProductAgg.java:
##########
@@ -89,7 +89,7 @@ public Object retract(Object accumulator, Object inputField) {
         Object product;
 
         if (accumulator == null || inputField == null) {
-            product = (accumulator == null ? inputField : accumulator);
+            product = (accumulator == null ? inverse(inputField) : accumulator);

Review Comment:
   ok, I'll close it.



-- 
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 retract behavior for FieldProductAgg [paimon]

Posted by "herefree (via GitHub)" <gi...@apache.org>.
herefree closed pull request #4835: [core] Fix retract behavior for FieldProductAgg
URL: https://github.com/apache/paimon/pull/4835


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