[ https://issues.apache.org/jira/browse/SPARK-21785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16192433#comment-16192433 ]
Takeshi Yamamuro commented on SPARK-21785: ------------------------------------------ {code} scala> sql("""CREATE TABLE customer USING parquet OPTIONS (path '/tmp/spark-tpcds/customer')""") res0: org.apache.spark.sql.DataFrame = [] scala> spark.table("customer").printSchema root |-- c_customer_sk: integer (nullable = true) |-- c_customer_id: string (nullable = true) |-- c_current_cdemo_sk: integer (nullable = true) |-- c_current_hdemo_sk: integer (nullable = true) |-- c_current_addr_sk: integer (nullable = true) |-- c_first_shipto_date_sk: integer (nullable = true) |-- c_first_sales_date_sk: integer (nullable = true) |-- c_salutation: string (nullable = true) |-- c_first_name: string (nullable = true) |-- c_last_name: string (nullable = true) |-- c_preferred_cust_flag: string (nullable = true) |-- c_birth_day: integer (nullable = true) |-- c_birth_month: integer (nullable = true) |-- c_birth_year: integer (nullable = true) |-- c_birth_country: string (nullable = true) |-- c_login: string (nullable = true) |-- c_email_address: string (nullable = true) |-- c_last_review_date: string (nullable = true) {code} Am I missing something? > 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