[ 
https://issues.apache.org/jira/browse/DRILL-7587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17048311#comment-17048311
 ] 

ASF GitHub Bot commented on DRILL-7587:
---------------------------------------

arina-ielchiieva commented on pull request #2002: DRILL-7587: Fix ValuesPrule 
distribution trait type
URL: https://github.com/apache/drill/pull/2002#discussion_r386030215
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrule.java
 ##########
 @@ -17,25 +17,23 @@
  */
 package org.apache.drill.exec.planner.physical;
 
-import org.apache.calcite.plan.RelOptRule;
-import org.apache.drill.exec.planner.logical.DrillRelFactories;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.drill.exec.planner.logical.DrillRel;
 import org.apache.drill.exec.planner.logical.DrillValuesRel;
 import org.apache.drill.exec.planner.logical.RelOptHelper;
-import org.apache.calcite.plan.RelOptRuleCall;
 
-public class ValuesPrule extends RelOptRule {
+public class ValuesPrule extends Prule {
 
   public static final ValuesPrule INSTANCE = new ValuesPrule();
 
   private ValuesPrule() {
-    super(RelOptHelper.any(DrillValuesRel.class), 
DrillRelFactories.LOGICAL_BUILDER, "Prel.ValuesPrule");
+    super(RelOptHelper.any(DrillValuesRel.class, DrillRel.DRILL_LOGICAL), 
"Prel.ValuesPrule");
   }
 
   @Override
   public void onMatch(final RelOptRuleCall call) {
-    final DrillValuesRel rel = call.rel(0);
+    DrillValuesRel rel = call.rel(0);
     call.transformTo(new ValuesPrel(rel.getCluster(), rel.getRowType(), 
rel.getTuples(),
-        rel.getTraitSet().plus(Prel.DRILL_PHYSICAL), rel.getContent()));
+      
rel.getTraitSet().plus(Prel.DRILL_PHYSICAL).plus(DrillDistributionTrait.SINGLETON),
 rel.getContent()));
 
 Review comment:
   Sure, added explanation comments.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Query with VALUES clause returns the wrong result when planner.slice_target 
> is small
> ------------------------------------------------------------------------------------
>
>                 Key: DRILL-7587
>                 URL: https://issues.apache.org/jira/browse/DRILL-7587
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.16.0, 1.17.0
>            Reporter: Vova Vysotskyi
>            Assignee: Arina Ielchiieva
>            Priority: Critical
>              Labels: ready-to-commit
>             Fix For: 1.18.0
>
>
> *Problem description*
>  The query returns the wrong result when {{planner.slice_target}} is less 
> than the rows count returned fromĀ {{VALUES}}.
> *Steps to reproduce*
>  1. Set {{planner.slice_target}} to 1:
> {code:sql}
> set `planner.slice_target`=1;
> {code}
> 2. Run query with {{VALUES}} clause which returns more rows than 1:
> {code:sql}
> select id, name from (values(1234567890123456789, 'a'), 
> (-1234567890123456789, 'z')) t(id, name);
> {code}
> *Expected result*
> {noformat}
> +----------------------+------+
> |          id          | name |
> +----------------------+------+
> | 1234567890123456789  | a    |
> | -1234567890123456789 | z    |
> +----------------------+------+
> {noformat}
> *Actual result*
> {noformat}
> +----------------------+------+
> |          id          | name |
> +----------------------+------+
> | 1234567890123456789  | a    |
> | 1234567890123456789  | a    |
> | -1234567890123456789 | z    |
> | -1234567890123456789 | z    |
> +----------------------+------+
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to