hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish K Singh (JIRA)" <>
Subject [jira] [Commented] (HIVE-10593) Support creating table from a file schema: CREATE TABLE ... LIKE <file_format> '/path/to/file'
Date Mon, 18 May 2015 20:16:59 GMT


Ashish K Singh commented on HIVE-10593:

[~lskuff], as part of HIVE-8950, I initially added capability to create hive table with schema
from a specified parquet file, specified as a 'parquet.file' table property. The concern then
became that we are adding a file path in table properties. The file will only be used during
the table creation, but can be deleted after that. We thought and discussed two possible options
to avoid it. First, remove the table property after successfully creating the table. Second,
restrict this capability only to external tables. I could not find a way to modify table property
without a major refactoring and it seems like most of the use cases can be addressed by having
a dir with parquet data and then creating an external hive table pointing to that dir. Hive
will look for a parquet file in the dir and get the schema from that file. Makes sense?

> 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