You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/09/02 23:11:00 UTC

[jira] [Work logged] (HIVE-26477) Iceberg: `CREATE TABLE LIKE STORED BY ICEBERG` failing with NullPointerException

     [ https://issues.apache.org/jira/browse/HIVE-26477?focusedWorklogId=805891&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-805891 ]

ASF GitHub Bot logged work on HIVE-26477:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Sep/22 23:10
            Start Date: 02/Sep/22 23:10
    Worklog Time Spent: 10m 
      Work Description: ayushtkn commented on code in PR #3553:
URL: https://github.com/apache/hive/pull/3553#discussion_r962059266


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -13906,8 +13906,12 @@ ASTNode analyzeCreateTable(
       rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), crtTranTblDesc)));
       break;
 
-    case CTLT: // create table like <tbl_name>
+    case CTLT:// create table like <tbl_name>
 
+      if (handler != null && !handler.supportsCTLT()) {
+        throw new SemanticException("Unsupported operation. " + qualifiedTabName.getTable() +
+            " cannot be created using CTLT syntax. ");

Review Comment:
   Should we have an entry in the ErrorMsg.java for this case. There are couple of similar instanses for unspupported cases like ``TRUNCATE_FOR_NON_MANAGED_TABLE`` & for CTAS as well ``CTAS_LOCATION_NONEMPTY`` we can we have one like ``CTLT_FOR_ICEBERG_TABLE`` for this case?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 805891)
    Time Spent: 1h 10m  (was: 1h)

> Iceberg: `CREATE TABLE LIKE STORED BY ICEBERG` failing with NullPointerException
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-26477
>                 URL: https://issues.apache.org/jira/browse/HIVE-26477
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Manthan B Y
>            Assignee: László Pintér
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> *Steps to Reproduce:*
>  # Open Beeline session
>  # Execute the following queries
> {code:java}
> CREATE TABLE t0(c0 FLOAT, c1 boolean, c2 smallint);
> CREATE TABLE t1 LIKE t0 STORED BY ICEBERG;{code}
> *Result:*
> {code:java}
> Error while compiling statement: FAILED: Execution Error, return code 40000 from org.apache.hadoop.hive.ql.ddl.DDLTask. java.lang.NullPointerException at org.apache.hadoop.hive.ql.ddl.table.create.like.CreateTableLikeOperation.setStorage(CreateTableLikeOperation.java:186) at org.apache.hadoop.hive.ql.ddl.table.create.like.CreateTableLikeOperation.createTableLikeTable(CreateTableLikeOperation.java:125) at org.apache.hadoop.hive.ql.ddl.table.create.like.CreateTableLikeOperation.execute(CreateTableLikeOperation.java:65) at org.apache.hadoop.hive.ql.ddl.DDLTask.execute(DDLTask.java:84) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:213) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:105) at org.apache.hadoop.hive.ql.Executor.launchTask(Executor.java:360) at org.apache.hadoop.hive.ql.Executor.launchTasks(Executor.java:333) at org.apache.hadoop.hive.ql.Executor.runTasks(Executor.java:250) at org.apache.hadoop.hive.ql.Executor.execute(Executor.java:111) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:791) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:540) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:534) at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:166) at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:232) at org.apache.hive.service.cli.operation.SQLOperation.access$700(SQLOperation.java:89) at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:338) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899) at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:358) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750){code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)