You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2016/08/20 05:50:13 UTC
[GitHub] spark pull request #14727: [SPARK-17166] [SQL] Store Table Properties Specif...
GitHub user gatorsmile opened a pull request:
https://github.com/apache/spark/pull/14727
[SPARK-17166] [SQL] Store Table Properties Specified in CTAS after Conversion to Data Source Tables
## What changes were proposed in this pull request?
CTAS lost table properties after conversion to data source tables. For example,
```SQL
CREATE TABLE t TBLPROPERTIES('prop1' = 'c', 'prop2' = 'd') AS SELECT 1 as a, 1 as b
```
The output of `DESC FORMATTED t` does not have the related properties.
```
|Table Parameters: | | |
| rawDataSize |-1 | |
| numFiles |1 | |
| transient_lastDdlTime |1471670983 | |
| totalSize |496 | |
| spark.sql.sources.provider|parquet | |
| EXTERNAL |FALSE | |
| COLUMN_STATS_ACCURATE |false | |
| numRows |-1 | |
| | | |
|# Storage Information | | |
|SerDe Library: |org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe | |
|InputFormat: |org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat | |
|OutputFormat: |org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat | |
|Compressed: |No | |
|Storage Desc Parameters: | | |
| serialization.format |1 | |
| path |file:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/warehouse-f3aa2927-6464-4a35-a715-1300dde6c614/t| |
```
After the fix, the properties specified by users are stored as serde properties, since the table properties are used for storing table schemas and system generated properties.
```
|Table Parameters: | | |
| rawDataSize |-1 | |
| numFiles |1 | |
| transient_lastDdlTime |1471672182 | |
| totalSize |496 | |
| spark.sql.sources.provider|parquet | |
| EXTERNAL |FALSE | |
| COLUMN_STATS_ACCURATE |false | |
| numRows |-1 | |
| | | |
|# Storage Information | | |
|SerDe Library: |org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe | |
|InputFormat: |org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat | |
|OutputFormat: |org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat | |
|Compressed: |No | |
|Storage Desc Parameters: | | |
| prop2 |d | |
| prop1 |c | |
| serialization.format |1 | |
| path |file:/private/var/folders/4b/sgmfldk15js406vk7lw5llzw0000gn/T/warehouse-78c38cea-02c9-40aa-9b20-9803686069ae/t| |
+----------------------------+--------------------------------------------------------------------------------------------------------------+-------+
```
## How was this patch tested?
Added a test case.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gatorsmile/spark tablePropertiesLoss
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14727.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14727
----
commit bffc412b4ce50ffc63da0f6b05d82f7dd52a97fd
Author: gatorsmile <ga...@gmail.com>
Date: 2016-08-20T05:40:52Z
fix.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14727: [SPARK-17166] [SQL] Store Table Properties in CTAS that ...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14727
**[Test build #64125 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64125/consoleFull)** for PR 14727 at commit [`bffc412`](https://github.com/apache/spark/commit/bffc412b4ce50ffc63da0f6b05d82f7dd52a97fd).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14727: [SPARK-17166] [SQL] Store Table Properties in CTAS that ...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14727
**[Test build #64125 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64125/consoleFull)** for PR 14727 at commit [`bffc412`](https://github.com/apache/spark/commit/bffc412b4ce50ffc63da0f6b05d82f7dd52a97fd).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #14727: [SPARK-17166] [SQL] Store Table Properties in CTA...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile closed the pull request at:
https://github.com/apache/spark/pull/14727
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #14727: [SPARK-17166] [SQL] Store Table Properties in CTA...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/14727#discussion_r75580371
--- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala ---
@@ -653,6 +653,20 @@ class HiveDDLSuite
}
}
+ test("CTAS - converted to Data Source Table but lost table properties") {
+ withSQLConf(SQLConf.CONVERT_CTAS.key -> "true") {
+ withTable("t") {
+ sql("CREATE TABLE t TBLPROPERTIES('prop1' = 'c', 'prop2' = 'd') AS SELECT 1 as a, 1 as b")
+ val tableDesc = spark.sessionState.catalog.getTableMetadata(TableIdentifier("t"))
+ assert(tableDesc.properties.get("prop1").isEmpty)
+ assert(tableDesc.properties.get("prop2").isEmpty)
+ assert(tableDesc.storage.properties.get("prop1") == Option("c"))
+ assert(tableDesc.storage.properties.get("prop2") == Option("d"))
--- End diff --
uh, agree! Let me close this PR. Thanks!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #14727: [SPARK-17166] [SQL] Store Table Properties in CTA...
Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/14727#discussion_r75580329
--- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala ---
@@ -653,6 +653,20 @@ class HiveDDLSuite
}
}
+ test("CTAS - converted to Data Source Table but lost table properties") {
+ withSQLConf(SQLConf.CONVERT_CTAS.key -> "true") {
+ withTable("t") {
+ sql("CREATE TABLE t TBLPROPERTIES('prop1' = 'c', 'prop2' = 'd') AS SELECT 1 as a, 1 as b")
+ val tableDesc = spark.sessionState.catalog.getTableMetadata(TableIdentifier("t"))
+ assert(tableDesc.properties.get("prop1").isEmpty)
+ assert(tableDesc.properties.get("prop2").isEmpty)
+ assert(tableDesc.storage.properties.get("prop1") == Option("c"))
+ assert(tableDesc.storage.properties.get("prop2") == Option("d"))
--- End diff --
is this what we want? Why do the table properties in Hive serde table should go to storage properties in data source table?
Ideally data source table should have data source options(storage properties) and table properties. Currently we don't support specifying table properties for data source tables, but it doesn't mean we will never do it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14727: [SPARK-17166] [SQL] Store Table Properties in CTAS that ...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14727
Merged build finished. Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14727: [SPARK-17166] [SQL] Store Table Properties in CTAS that ...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/14727
cc @cloud-fan @yhuai This is what we discussed in another PR. Could you please review whether this is a right fix? Thanks!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #14727: [SPARK-17166] [SQL] Store Table Properties in CTAS that ...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14727
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/64125/
Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org