Skip to content

Avoid underestimating size of partitioned hive tables#17677

Merged
raunaqmorarka merged 2 commits intotrinodb:masterfrom
Dith3r:ke/not-analyzed
Jun 6, 2023
Merged

Avoid underestimating size of partitioned hive tables#17677
raunaqmorarka merged 2 commits intotrinodb:masterfrom
Dith3r:ke/not-analyzed

Conversation

@Dith3r
Copy link
Copy Markdown
Member

@Dith3r Dith3r commented May 29, 2023

Description

For not analyzed tables hive connector return rowCount equal to 0, which makes CBO to choose wrong execution plan, for example choosing broadcast join. This PR change 0 to NaN avoiding such situations.

Additional context and related issues

Release notes

( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:

# Hive
* Improve query performance on partitioned hive tables in the absence of table statistics. ({issue}`17677`)

@cla-bot cla-bot bot added the cla-signed label May 29, 2023
@Dith3r Dith3r requested a review from raunaqmorarka May 29, 2023 11:12
@github-actions github-actions bot added hive Hive connector tests:hive labels May 29, 2023
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 2 times, most recently from 8747df9 to 09324e0 Compare May 29, 2023 12:40
@Dith3r Dith3r requested a review from lukasz-stec May 29, 2023 13:15
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 5 times, most recently from 2973348 to 1e0f15c Compare May 30, 2023 08:30
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 2 times, most recently from 277a074 to 833d0c0 Compare May 30, 2023 11:40
@Dith3r Dith3r requested a review from raunaqmorarka May 30, 2023 11:59
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 2 times, most recently from 9d42851 to 18677a5 Compare May 30, 2023 12:22
@Dith3r Dith3r marked this pull request as ready for review May 30, 2023 12:42
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/AbstractTestHive.java Outdated
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileMetastore.java Outdated
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileMetastore.java Outdated
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 2 times, most recently from 3e4069b to b490f10 Compare May 31, 2023 08:07
@Dith3r Dith3r requested a review from raunaqmorarka May 31, 2023 08:13
@Dith3r Dith3r force-pushed the ke/not-analyzed branch from b490f10 to d3ec8f3 Compare May 31, 2023 08:33
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/AbstractTestHive.java Outdated
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/BaseHiveConnectorTest.java Outdated
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileMetastore.java Outdated
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileMetastore.java Outdated
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileMetastore.java Outdated
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 4 times, most recently from a073174 to 6a74e7c Compare June 1, 2023 10:40
@Dith3r Dith3r force-pushed the ke/not-analyzed branch 2 times, most recently from 2941ce6 to 76ebc5e Compare June 5, 2023 10:24
Comment thread plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveFileMetastore.java Outdated
@Dith3r Dith3r force-pushed the ke/not-analyzed branch from 76ebc5e to 8d56f60 Compare June 6, 2023 07:54
@Dith3r Dith3r changed the title Partitioned table rowCount 0 treated as NaN Avoid underestimating size of partitioned hive tables Jun 6, 2023
Copy link
Copy Markdown
Member

@raunaqmorarka raunaqmorarka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % minor comments

Comment thread plugin/trino-hive-hadoop2/src/test/java/io/trino/plugin/hive/TestHive.java Outdated
Comment thread plugin/trino-hive-hadoop2/src/test/java/io/trino/plugin/hive/TestHive.java Outdated
@Dith3r Dith3r force-pushed the ke/not-analyzed branch from 8d56f60 to e62319c Compare June 6, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed hive Hive connector

Development

Successfully merging this pull request may close these issues.

2 participants