[ https://issues.apache.org/jira/browse/SPARK-21785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16193209#comment-16193209 ]
Jacky Shen edited comment on SPARK-21785 at 10/5/17 5:28 PM: ------------------------------------------------------------- Yes, we can create table from existing parquet file and it is a good solution. but for the request itself, the user want to create table with the schema from the given parquet file and specify a different location to the table. Maybe more other table properties. that's the "create table ... using parquet" cannot achieve. {code:java} spark-sql> create table table2 using parquet options(path 'test-data/dec-in-fixed-len.parquet') location '/tmp/table1'; Error in query: LOCATION and 'path' in OPTIONS are both used to indicate the custom table path, you can only specify one of them.(line 1, pos 0) {code} was (Author: jacshen): Yes, we can create table from existing parquet file and it is a good solution. but for the request itself, the user want to create table with the schema from the given parquet file and specify a different location to the table. Maybe more other table properties. that's the "create table ... using parquet" cannot achieve. {code:java} spark-sql> create table table2 using parquet options(path '/Users/jacshen/project/git-rep/spark/sql/core/src/test/resources/test-data/dec-in-fixed-len.parquet') location '/tmp/table1'; Error in query: LOCATION and 'path' in OPTIONS are both used to indicate the custom table path, you can only specify one of them.(line 1, pos 0) {code} > Support create table from a file schema > --------------------------------------- > > Key: SPARK-21785 > URL: https://issues.apache.org/jira/browse/SPARK-21785 > Project: Spark > Issue Type: Wish > Components: SQL > Affects Versions: 2.1.1, 2.2.0 > Reporter: liupengcheng > Labels: sql > > Current spark doest not support creating a table from a file schema > for example: > {code:java} > CREATE EXTERNAL TABLE IF NOT EXISTS test LIKE PARQUET > '/user/test/abc/a.snappy.parquet' STORED AS PARQUET LOCATION > '/user/test/def/'; > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org