You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/12/06 10:52:41 UTC

[GitHub] [druid] abhishekagarwal87 opened a new pull request, #13508: Better error message when theta_sketch_intersect is used on scalar expression

abhishekagarwal87 opened a new pull request, #13508:
URL: https://github.com/apache/druid/pull/13508

   
   This PR has:
   
   - [ ] been self-reviewed.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   


-- 
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@druid.apache.org

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


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


[GitHub] [druid] abhishekagarwal87 commented on a diff in pull request #13508: Better error message when theta_sketch_intersect is used on scalar expression

Posted by GitBox <gi...@apache.org>.
abhishekagarwal87 commented on code in PR #13508:
URL: https://github.com/apache/druid/pull/13508#discussion_r1040849799


##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSetBaseOperatorConversion.java:
##########
@@ -63,6 +63,8 @@ public DruidExpression toDruidExpression(
       RexNode rexNode
   )
   {
+    plannerContext.setPlanningError("%s can only be used on aggregates. " +
+        "It cannot be used directly on a column or or on a scalar expression.", getFunctionName());

Review Comment:
   the type check is already done. This tells the user that they are trying to use the function as an expression while its only available as a post aggregator. 



-- 
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@druid.apache.org

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


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


[GitHub] [druid] kfaraz commented on a diff in pull request #13508: Better error message when theta_sketch_intersect is used on scalar expression

Posted by GitBox <gi...@apache.org>.
kfaraz commented on code in PR #13508:
URL: https://github.com/apache/druid/pull/13508#discussion_r1040814081


##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSetBaseOperatorConversion.java:
##########
@@ -63,6 +63,8 @@ public DruidExpression toDruidExpression(
       RexNode rexNode
   )
   {
+    plannerContext.setPlanningError("%s can only be used on aggregates. " +
+        "It cannot be used directly on a column or or on a scalar expression.", getFunctionName());

Review Comment:
   typo: double `or`
   
   Since the error message is specific to theta sketch, maybe we can mention the exact type of arguments this function expects, rather than mentioning what it cannot accept.



-- 
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@druid.apache.org

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


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


[GitHub] [druid] kfaraz commented on a diff in pull request #13508: Better error message when theta_sketch_intersect is used on scalar expression

Posted by GitBox <gi...@apache.org>.
kfaraz commented on code in PR #13508:
URL: https://github.com/apache/druid/pull/13508#discussion_r1040932463


##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/sql/ThetaSketchSetBaseOperatorConversion.java:
##########
@@ -63,6 +63,8 @@ public DruidExpression toDruidExpression(
       RexNode rexNode
   )
   {
+    plannerContext.setPlanningError("%s can only be used on aggregates. " +
+        "It cannot be used directly on a column or or on a scalar expression.", getFunctionName());

Review Comment:
   Ah, okay. Thanks for the clarification.



-- 
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@druid.apache.org

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


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


[GitHub] [druid] kfaraz merged pull request #13508: Better error message when theta_sketch_intersect is used on scalar expression

Posted by GitBox <gi...@apache.org>.
kfaraz merged PR #13508:
URL: https://github.com/apache/druid/pull/13508


-- 
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@druid.apache.org

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


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