You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/03/21 08:11:59 UTC

[GitHub] [hive] kasakrisz opened a new pull request #3120: HIVE-26043: Use constraint info when creating RexNodes

kasakrisz opened a new pull request #3120:
URL: https://github.com/apache/hive/pull/3120


   ### What changes were proposed in this pull request?
   Use the data type coming from the Calcite `RelDataType` when creating `RexNode`s from `ColumnInfo` if possible. This process is part of the compilation: converting the query represented by QB objects and AST subtrees to Calcite logical plan.
   
   ### Why are the changes needed?
   When TableScan logical operators are created table constraint information is pulled from the metastore and applied the `RelDataType` associated to the TS operator. 
   Constraints like `not null` has an affect the way Hive rewrites subqueries to joins. Example: if the optimizer is aware that the lhs of an in subquery can not be null a simpler rewrite is chosen. See jira for example plans.
   
   ### Does this PR introduce _any_ user-facing change?
   No, but `explain` command output may be different in older Hive versions.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestTezTPCDS30TBPerfCliDriver -Dqfile=query45.q -pl itests/qtest -Pitests
   mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=subquery_in.q -pl itests/qtest -Pitests
   ```


-- 
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: gitbox-unsubscribe@hive.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on pull request #3120: HIVE-26043: Use constraint info when creating RexNodes

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on pull request #3120:
URL: https://github.com/apache/hive/pull/3120#issuecomment-1074771467


   @zabetak
   Including the nullability flag to `ColumnInfo` can be nicer solution: #3121 
   Thanks for the tip.


-- 
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: gitbox-unsubscribe@hive.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] zabetak commented on pull request #3120: HIVE-26043: Use constraint info when creating RexNodes

Posted by GitBox <gi...@apache.org>.
zabetak commented on pull request #3120:
URL: https://github.com/apache/hive/pull/3120#issuecomment-1073795144


   @kasakrisz Have you explored the option of including the nullability information in `ColumnInfo`? I think that doing this would allow changes to be centralized in `TypeConverter` and keep the code more uniform.


-- 
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: gitbox-unsubscribe@hive.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz closed pull request #3120: HIVE-26043: Use constraint info when creating RexNodes

Posted by GitBox <gi...@apache.org>.
kasakrisz closed pull request #3120:
URL: https://github.com/apache/hive/pull/3120


   


-- 
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: gitbox-unsubscribe@hive.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org