Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18647][SQL] do not put provider in table properties for Hive serde table - #16080
[SPARK-18647][SQL] do not put provider in table properties for Hive serde table#16080cloud-fan wants to merge 3 commits into
Conversation
cloud-fan
commented
Nov 30, 2016
SparkQA
commented
Nov 30, 2016
Test build #69406 has finished for PR 16080 at commit
|
| val tableProperties = tableMetaToTableProps(table) | ||
| // put table provider and partition provider in table properties. | ||
| tableProperties.put(DATASOURCE_PROVIDER, provider) |
There was a problem hiding this comment.
Why are we putting the provider name in the table properties here?
There was a problem hiding this comment.
Previously we store the provider in the code path for both data source and hive serde tables. Now I move it to the data source table only code path.
mallman
commented
Nov 30, 2016
I built and tested this branch, and it resolves the issue I was having with reading Spark 2.1 tables in earlier versions of Spark. Thanks! |
rxin
commented
Nov 30, 2016
We need a test case here. |
gatorsmile
commented
Nov 30, 2016
We need to provide forward compatibility? That is pretty hard. |
rxin
commented
Nov 30, 2016
In a lot of environments people run multiple Spark versions side by side. That's always been a big strength of Spark. |
cloud-fan
commented
Dec 1, 2016
@rxin I'm afraid it's hard to write forward compatibility tests using unit test, we may need an external test infrastructure(python scripts) to do this. |
rxin
commented
Dec 1, 2016
We can have a test to check the table properties don't contain the entry, can't we? |
gatorsmile
commented
Dec 1, 2016
I see. Will be careful in the future to not break the forward compatibility. |
SparkQA
commented
Dec 1, 2016
Test build #69459 has finished for PR 16080 at commit
|
SparkQA
commented
Dec 1, 2016
Test build #69465 has finished for PR 16080 at commit
|
| provider = Some("hive")) | ||
| catalog.createTable(hiveTable, ignoreIfExists = false) | ||
| val rawTable = externalCatalog.client.getTable("db1", "hive_tbl") |
There was a problem hiding this comment.
Could we also add one more check for another API externalCatalog.getTable("db1", "hive_tbl")? The provider should contain DDLUtils.HIVE_PROVIDER
gatorsmile
commented
Dec 1, 2016
The |
cloud-fan
commented
Dec 2, 2016
@gatorsmile , |
SparkQA
commented
Dec 2, 2016
Test build #69525 has finished for PR 16080 at commit
|
gatorsmile
commented
Dec 2, 2016
@cloud-fan True. That is not the LGTM pending test |
SparkQA
commented
Dec 2, 2016
Test build #69535 has finished for PR 16080 at commit
|
…erde table
## What changes were proposed in this pull request?
In Spark 2.1, we make Hive serde tables case-preserving by putting the table metadata in table properties, like what we did for data source table. However, we should not put table provider, as it will break forward compatibility. e.g. if we create a Hive serde table with Spark 2.1, using `sql("create table test stored as parquet as select 1")`, we will fail to read it with Spark 2.0, as Spark 2.0 mistakenly treat it as data source table because there is a `provider` entry in table properties.
Logically Hive serde table's provider is always hive, we don't need to store it in table properties, this PR removes it.
## How was this patch tested?
manually test the forward compatibility issue.
Author: Wenchen Fan <wenchen@databricks.com>
Closes#16080 from cloud-fan/hive.
(cherry picked from commit a5f02b0)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>cloud-fan
commented
Dec 2, 2016
thanks for the review, merging to master/2.1! |
…erde table
## What changes were proposed in this pull request?
In Spark 2.1, we make Hive serde tables case-preserving by putting the table metadata in table properties, like what we did for data source table. However, we should not put table provider, as it will break forward compatibility. e.g. if we create a Hive serde table with Spark 2.1, using `sql("create table test stored as parquet as select 1")`, we will fail to read it with Spark 2.0, as Spark 2.0 mistakenly treat it as data source table because there is a `provider` entry in table properties.
Logically Hive serde table's provider is always hive, we don't need to store it in table properties, this PR removes it.
## How was this patch tested?
manually test the forward compatibility issue.
Author: Wenchen Fan <wenchen@databricks.com>
Closesapache#16080 from cloud-fan/hive.…erde table
## What changes were proposed in this pull request?
In Spark 2.1, we make Hive serde tables case-preserving by putting the table metadata in table properties, like what we did for data source table. However, we should not put table provider, as it will break forward compatibility. e.g. if we create a Hive serde table with Spark 2.1, using `sql("create table test stored as parquet as select 1")`, we will fail to read it with Spark 2.0, as Spark 2.0 mistakenly treat it as data source table because there is a `provider` entry in table properties.
Logically Hive serde table's provider is always hive, we don't need to store it in table properties, this PR removes it.
## How was this patch tested?
manually test the forward compatibility issue.
Author: Wenchen Fan <wenchen@databricks.com>
Closesapache#16080 from cloud-fan/hive.
What changes were proposed in this pull request?
In Spark 2.1, we make Hive serde tables case-preserving by putting the table metadata in table properties, like what we did for data source table. However, we should not put table provider, as it will break forward compatibility. e.g. if we create a Hive serde table with Spark 2.1, using
sql("create table test stored as parquet as select 1"), we will fail to read it with Spark 2.0, as Spark 2.0 mistakenly treat it as data source table because there is aproviderentry in table properties.Logically Hive serde table's provider is always hive, we don't need to store it in table properties, this PR removes it.
How was this patch tested?
manually test the forward compatibility issue.