[
https://issues.apache.org/jira/browse/HIVE-9576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15150740#comment-15150740
]
Stephen Miller commented on HIVE-9576:
--------------------------------------
If it helps, the following command does work:
CREATE TABLE MyNewTable
LIKE MyOldTable
STORED AS (e.g.) PARQUET;
So at least you can copy over the schema easily.
I suspect changing storage type under the hood is trickier than it sounds if
you want the table to remain writeable during the process; there would be delta
files involved.
> ALTER TABLE STORED AS - change storage format and/or compression
> ----------------------------------------------------------------
>
> Key: HIVE-9576
> URL: https://issues.apache.org/jira/browse/HIVE-9576
> Project: Hive
> Issue Type: New Feature
> Components: Compression, File Formats, Parser, Query Planning, Query
> Processor, Serializers/Deserializers, SQL, StorageHandler
> Affects Versions: 0.14.0
> Environment: HDP 2.2
> Reporter: Hari Sekhon
>
> Feature request to support rewriting a table into a different format or
> compression level via a single alter table statement:
> {code}ALTER TABLE ... STORED AS... TBLPROPERTIES(...){code}
> Currently we create a new table of a different format and do
> {code}INSERT OVERWRITE newtable SELECT * FROM oldtable{code}
> but a colleague has just asked me why this can't be handled by a single alter
> statement via a tempory table replacement under the hood, which seems like a
> fair question.
> Best Regards,
> Hari Sekhon
> http://www.linkedin.com/in/harisekhon
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)