[
https://issues.apache.org/jira/browse/HIVE-16720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16022651#comment-16022651
]
Barna Zsombor Klara commented on HIVE-16720:
--------------------------------------------
[~venkatakarthik], well cascade is guaranteed to work, which is definitely a
substantial benefit :). The problem is that we have column information on both
the table and the partition level. As long as no columns are dropped or
reordered just added to the table it will work fine, but if you replace
columns, or just drop from the table but not the partition then you may end up
with the exception like you got in the description.
I am still looking into a possible solution but it is a bit tricky without
significant performance overhead, so I may be forced to leave it like this.
FYI there is a HiveConf property introduced in HIVE-4409 that would check
column incompatibility during an alter statement. Setting this to true should
at least prevent you from ending up with a table you can't select from.
> Reorder columns in Hive parquet tables
> --------------------------------------
>
> Key: HIVE-16720
> URL: https://issues.apache.org/jira/browse/HIVE-16720
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Affects Versions: 1.1.0
> Reporter: Venkata Karthik Penikalapati
>
> We are using hive 1.1.0 have a requirement to reorder columns for one of huge
> table with 100's of columns for user readability. But when we reorder columns
> in table its failing with below error.
> hive> desc test_parquet;
> OK
> name string
> age int
> dept string
> salary string
> city string
> # Partition Information
> # col_name data_type comment
> city string
> Time taken: 0.053 seconds, Fetched: 10 row(s)
> hive> ALTER TABLE test_parquet REPLACE COLUMNS (age int,name string, dept
> string, salary string);
> OK
> Time taken: 0.451 seconds
> hive> desc test_parquet;
> OK
> age int
> name string
> dept string
> salary string
> city string
> # Partition Information
> # col_name data_type comment
> city string
> Time taken: 0.051 seconds, Fetched: 10 row(s)
> hive> select * from test_parquet;
> OK
> Failed with exception
> java.io.IOException:java.lang.UnsupportedOperationException: Cannot inspect
> org.apache.hadoop.io.IntWritable
> Time taken: 0.121 seconds
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)