You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Aaron2Ti (via GitHub)" <gi...@apache.org> on 2023/04/02 16:58:17 UTC

[GitHub] [doris] Aaron2Ti opened a new pull request, #18318: Support aggregate type of REPLACE_IF_NULL

Aaron2Ti opened a new pull request, #18318:
URL: https://github.com/apache/doris/pull/18318

   Usecases are when we only want to record the first seen value, such as users' initial choice of some enumerated value etc
   
   # Proposed changes
   
   Support aggregate type of REPLACE_IF_NULL
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   similar to this request https://github.com/apache/doris/issues/2117#issuecomment-1324854366
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [x] Has unit tests been added
   * [x] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [x] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #18318: Support aggregate type of REPLACE_IF_NULL

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18318:
URL: https://github.com/apache/doris/pull/18318#issuecomment-1493391941

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [feature] Support aggregate type of REPLACE_IF_NULL [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18318:
URL: https://github.com/apache/doris/pull/18318#issuecomment-1975412712

   We're closing this PR because it hasn't been updated in a while.
   This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Aaron2Ti commented on a diff in pull request #18318: Support aggregate type of REPLACE_IF_NULL

Posted by "Aaron2Ti (via GitHub)" <gi...@apache.org>.
Aaron2Ti commented on code in PR #18318:
URL: https://github.com/apache/doris/pull/18318#discussion_r1155344625


##########
fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/dpp/SparkRDDAggregator.java:
##########
@@ -240,11 +242,19 @@ Object update(Object dst, Object src) {
     }
 }
 
+class ReplaceIfNullAggregator extends SparkRDDAggregator<Object> {
+
+    @Override
+    Object update(Object dst, Object src) {
+        return dst == null ? src : dst;
+    }
+}
+
 class ReplaceIfNotNullAggregator extends SparkRDDAggregator<Object> {
 
     @Override
     Object update(Object dst, Object src) {
-        return src == null ? dst : src;
+        return dst != null ? src : dst;

Review Comment:
   hi @wangbo 
   could you please help double review logic of this change please
   Regards



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] zhannngchen commented on pull request #18318: [feature] Support aggregate type of REPLACE_IF_NULL

Posted by "zhannngchen (via GitHub)" <gi...@apache.org>.
zhannngchen commented on PR #18318:
URL: https://github.com/apache/doris/pull/18318#issuecomment-1706019165

   The semantic of `REPLACE_IF_NULL` here is quite wired. 
   For `REPLACE_IF_NOT_NULL`, the semantic is that if user given a value that not NULL for some filed, we'll use the given value to replace the 'old value' in our DB.
   So in opposite, the semantic of `REPLACE_IF_NULL` should be: if user given a value that is NULL, we'll use it to replace the 'old value' in our DB, and ignore all of other given fields with not NULL 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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [feature] Support aggregate type of REPLACE_IF_NULL [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #18318: [feature] Support aggregate type of REPLACE_IF_NULL
URL: https://github.com/apache/doris/pull/18318


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org