hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio Peña (JIRA) <>
Subject [jira] [Commented] (HIVE-10593) Support creating table from a file schema: CREATE TABLE ... LIKE <file_format> '/path/to/file'
Date Tue, 19 May 2015 16:59:01 GMT


Sergio Peña commented on HIVE-10593:

I agree with [~rdblue]. So far, only Avro, Orc and Parquet contains magic bytes in their files,
and the schema is stored on their files as well. Other formats, like Json and text, will be
complicated to infer their schema. 

So, maybe a DDL like this?: {{CREATE TABLE mytable  LIKE '/path/to/file.format'}}

If whatever is after LIKE is a path, then use that file to infer the schema, if not, then
try to find the table name (current functionality).

> Support creating table from a file schema: CREATE TABLE ... LIKE <file_format>
> ----------------------------------------------------------------------------------------------
>                 Key: HIVE-10593
>                 URL:
>             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

This message was sent by Atlassian JIRA

View raw message