[ 
https://issues.apache.org/jira/browse/HIVE-10593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14526781#comment-14526781
 ] 

Lenni Kuff commented on HIVE-10593:
-----------------------------------

Thanks, I was not aware of HIVE-8950.

I agree, a standard syntax for all formats is very desirable. One downside of 
the syntax proposed in HIVE-8950 is that it is overloading the LOCATION 
keyword. This means it would not be possible to create a table with the same 
schema as a data file, but point that table to a different HDFS location 
(perhaps an edge case, but I can think of some uses). Thoughts?

> Support creating table from a file schema: CREATE TABLE ... LIKE 
> <file_format> '/path/to/file'
> ----------------------------------------------------------------------------------------------
>
>                 Key: HIVE-10593
>                 URL: https://issues.apache.org/jira/browse/HIVE-10593
>             Project: Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 1.2.0
>            Reporter: Lenni Kuff
>
> It would be useful if Hive could infer the column definitions in a create 
> table statement from the underlying data file. For example:
> CREATE TABLE new_tbl LIKE PARQUET '/path/to/file.parquet';
> If the targeted file is not the specified file format, the statement should 
> fail analysis. In addition to PARQUET, it would be useful to support other 
> formats such as AVRO, JSON, and ORC.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to