[
https://issues.apache.org/jira/browse/HIVE-26923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dharmik Thakkar resolved HIVE-26923.
------------------------------------
Resolution: Fixed
> Create Table As fails for iceberg when the columns are not specified.
> ---------------------------------------------------------------------
>
> Key: HIVE-26923
> URL: https://issues.apache.org/jira/browse/HIVE-26923
> Project: Hive
> Issue Type: Bug
> Components: Iceberg integration
> Reporter: Dharmik Thakkar
> Priority: Critical
>
> Create Table As fails for iceberg when the columns are not defined.
> Create table statement
> {code:java}
> create table xyz stored by iceberg stored by iceberg stored as orc
> TBLPROPERTIES ('format-version':'2') AS select name,age from studenttab10k
> group by name,age {code}
> Error logs
> {code:java}
> 2023-01-10T12:26:36,003 INFO [pool-3-thread-1] jdbc.TestDriver: Query:
> create table xyz stored by iceberg stored by iceberg stored as orc
> TBLPROPERTIES ('format-version':'2') AS select name,age from studenttab10k
> group by name,age
> 2023-01-10T12:26:36,094 INFO [Thread-5] jdbc.TestDriver: INFO : Compiling
> command(queryId=hive_20230110122636_8b4d7e37-c7b7-4554-a75a-51dfe37a4716):
> create table xyz stored by iceberg stored by iceberg stored as orc
> TBLPROPERTIES ('format-version':'2') AS select name,age from studenttab10k
> group by name,age
> 2023-01-10T12:26:36,095 INFO [Thread-5] jdbc.TestDriver: ERROR : FAILED:
> ParseException line 1:42 mismatched input 'by' expecting AS near 'stored' in
> table file format specification
> 2023-01-10T12:26:36,095 INFO [Thread-5] jdbc.TestDriver:
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:42 mismatched input
> 'by' expecting AS near 'stored' in table file format specification
> 2023-01-10T12:26:36,095 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:127)
> 2023-01-10T12:26:36,095 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:93)
> 2023-01-10T12:26:36,095 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:85)
> 2023-01-10T12:26:36,096 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.Compiler.parse(Compiler.java:174)
> 2023-01-10T12:26:36,096 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:103)
> 2023-01-10T12:26:36,096 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.Driver.compile(Driver.java:201)
> 2023-01-10T12:26:36,096 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:657)
> 2023-01-10T12:26:36,096 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:603)
> 2023-01-10T12:26:36,097 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:597)
> 2023-01-10T12:26:36,097 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:127)
> 2023-01-10T12:26:36,097 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:206)
> 2023-01-10T12:26:36,097 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:336)
> 2023-01-10T12:26:36,097 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.security.AccessController.doPrivileged(Native Method)
> 2023-01-10T12:26:36,097 INFO [Thread-5] jdbc.TestDriver: at
> java.base/javax.security.auth.Subject.doAs(Subject.java:423)
> 2023-01-10T12:26:36,098 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899)
> 2023-01-10T12:26:36,098 INFO [Thread-5] jdbc.TestDriver: at
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:358)
> 2023-01-10T12:26:36,098 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> 2023-01-10T12:26:36,098 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> 2023-01-10T12:26:36,099 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> 2023-01-10T12:26:36,099 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> 2023-01-10T12:26:36,099 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> 2023-01-10T12:26:36,099 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> 2023-01-10T12:26:36,099 INFO [Thread-5] jdbc.TestDriver: at
> java.base/java.lang.Thread.run(Thread.java:829)
> 2023-01-10T12:26:36,099 INFO [Thread-5] jdbc.TestDriver:
> {code}
> However for Hive the below query works
> {code:java}
> create table xyz stored as orc TBLPROPERTIES ('transactional' = 'true') AS
> select name,age from studenttab10k group by name,age;{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)