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 Mon, 04 May 2015 15:50:05 GMT


Sergio Peña commented on HIVE-10593:

There is an existing jira for Parquet that reads the schema from a file, and creates the table
using such schema, using something like {{CREATE TABLE tbl STORED AS PARQUET LOCATION '/path/to/file.parquet';}}
[HIVE-8950: Add support in ParquetHiveSerde to create table schema from a parquet file|]

Also, AVRO has its own tbl property that infers the schema from a file as well:
{{CREATE TABLE tbl STORED AS AVRO TBLPROPERTIES('avro.schema.url'='/path/to/file.url')}}

However, I like the idea of using the same statement syntax for all the formats we support.
Do you propose that we use the 'LIKE' syntax for this? or should we choose one from the supported
methods for parquet or avro?

> 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