Skip to content

Fix Hive race for CTAS statistics with IF NOT EXISTS#12895

Merged
electrum merged 1 commit intotrinodb:masterfrom
electrum:ctas-stats
Jul 20, 2022
Merged

Fix Hive race for CTAS statistics with IF NOT EXISTS#12895
electrum merged 1 commit intotrinodb:masterfrom
electrum:ctas-stats

Conversation

@electrum
Copy link
Member

@electrum electrum commented Jun 17, 2022

Description

Previously, concurrent CTAS IF NOT EXISTS queries for a non-existent
table would all try to update statistics for the table when the query
completed, even if they were not the query that created the table.
This could result in incorrect statistics if the queries were
different or non-deterministic, failures with the Glue metastore due
to concurrency errors, etc.

Documentation

(x) No documentation is needed.

Release notes

(x) Release notes entries required with the following suggested text:

# Hive connector
* Fix query failure or potentially incorrect statistics when running concurrent
  `CREATE TABLE AS` queries with the `IF NOT EXISTS` clause for the same
  non-existent table. ({issue}`12895`)

@cla-bot cla-bot bot added the cla-signed label Jun 17, 2022
@electrum electrum requested a review from dain June 17, 2022 23:13
Previously, concurrent CTAS IF NOT EXISTS queries for a non-existent
table would all try to update statistics for the table when the query
completed, even if they were not the query that created the table.
This could result in incorrect statistics if the queries were
different or non-deterministic, failures with the Glue metastore due
to concurrency errors, etc.
@findepi
Copy link
Member

findepi commented Jun 20, 2022

do we have same problem in Delta?

@findepi
Copy link
Member

findepi commented Jun 20, 2022

cc @alexjo2144

@electrum electrum requested a review from findepi July 19, 2022 23:20
@electrum electrum merged commit a2c8f98 into trinodb:master Jul 20, 2022
@electrum electrum deleted the ctas-stats branch July 20, 2022 06:05
@github-actions github-actions bot added this to the 391 milestone Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants