Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-28725: Sorting is performed when order by position is disabled when CBO is enabled #5623

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kasakrisz
Copy link
Contributor

What changes were proposed in this pull request?

  • Do not create a HiveSortLimit operator when hive.orderby.position.alias is disabled and the Order by clause of the query has integer constants as keys. Also ignore the constants as keys when there are both column references and constant keys.
  • Do not create HiveSortExchange operator when both field collaction and distribution keys are all constants and hive.orderby.position.alias is disabled. Also ignore the constants as keys when there are both column references and constant keys.

Why are the changes needed?

To synchronize the Order/Sort/Distribute/Cluster by behaviors when hive.orderby.position.alias is disabled and CBO is enabled/disabled .

Does this PR introduce any user-facing change?

Yes, the results of queries with Order/Sort/Cluster by clauses may have different order.

Is the change a dependency upgrade?

No.

How was this patch tested?

mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=cbo_distribute_sort_cluster_by_pos.q,cbo_rp_order_distribute_sort_cluster_by_cnst.q -pl itests/qtest -Pitests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants