You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed#6443. When creating an external table via KSHC with EXTERNAL and LOCATION specified, the KSHC table properties will include external=true(lowercase). Meanwhile, Hive Metastore automatically appends EXTERNAL=TRUE (uppercase). On some metastore backends (e.g. MySQL with a case-insensitive collation), this leads to a duplicate primary key conflict in TABLE_PARAMS.
This PR removes redundant table properties when KSHC creates tables. For example, the external property will be excluded.
How was this patch tested?
UT
Was this patch authored or co-authored using generative AI tooling?
how does this happen for SQL cases? I thought it should be handled by AstBuilder.cleanTableProperties, but it doesn't seem to be? could you please summarize the whole flow of the properties propagation?
how does this happen for SQL cases? I thought it should be handled by AstBuilder.cleanTableProperties, but it doesn't seem to be? could you please summarize the whole flow of the properties propagation?
In the parse phase, AstBuilder.cleanTableProperties is responsible for filtering/intercepting reserved properties from TBLPROPERTIES. For example, you cannot set reserved properties via TBLPROPERTIES (e.g., trying to use TBLPROPERTIES ('provider'='test') is not allowed).
In the physical plan phase, before CreateTableExec calls catalog.createTable(...), it invokes CatalogV2Util.convertTableProperties, which unify all properties (properties, options, serde, location, external, provider, etc.). The resulting map is passed as the properties argument to KSHC’s HiveTableCatalog.createTable. See: [SPARK-31257][SPARK-33561][SQL] Unify create table syntax spark#28026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
Fixed #6443. When creating an external table via KSHC with
EXTERNALandLOCATIONspecified, the KSHC table properties will includeexternal=true(lowercase). Meanwhile, Hive Metastore automatically appendsEXTERNAL=TRUE(uppercase). On some metastore backends (e.g. MySQL with a case-insensitive collation), this leads to a duplicate primary key conflict in TABLE_PARAMS.This PR removes redundant table properties when KSHC creates tables. For example, the
externalproperty will be excluded.How was this patch tested?
UT
Was this patch authored or co-authored using generative AI tooling?
No