spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Malinge (JIRA)" <>
Subject [jira] [Commented] (SPARK-22306) INFER_AND_SAVE overwrites important metadata in Metastore
Date Thu, 19 Oct 2017 17:52:00 GMT


David Malinge commented on SPARK-22306:


The issue does not happen. Leaves the bucketing/sorting/owner as is.

> INFER_AND_SAVE overwrites important metadata in Metastore
> ---------------------------------------------------------
>                 Key: SPARK-22306
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.0
>         Environment: Hive 2.3.0 (PostgresQL metastore, stored as Parquet)
> Spark 2.2.0
>            Reporter: David Malinge
> I noticed some critical changes on my hive tables and realized that they were caused
by a simple select on SparkSQL. Looking at the logs, I found out that this select was actually
performing an update on the database "Saving case-sensitive schema for table". 
> I then found out that Spark 2.2.0 introduces a new default value for spark.sql.hive.caseSensitiveInferenceMode
> The issue is that this update changes critical metadata of the table, in particular:
> - changes the owner to the current user
> - removes bucketing metadata (BUCKETING_COLS, SDS)
> - removes sorting metadata (SORT_COLS)
> Switching the property to: NEVER_INFER prevents the issue.
> Also, note that the damage can be fix manually in Hive with e.g.:
> {code:sql}
> alter table [table_name] 
> clustered by ([col1], [col2]) 
> sorted by ([colA], [colB])
> into [n] buckets
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message