[ 
https://issues.apache.org/jira/browse/FLINK-16402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17111159#comment-17111159
 ] 

Rui Li commented on FLINK-16402:
--------------------------------

Hey [~gyfora], what's the version of your HMS? I searched Hive code base for 
the error message "A managed table's location needs to be under the hive 
warehouse root directory", and it seems to exist only in the very latest code 
(probably added via HIVE-22189).

But even if you're using the latest Hive master code, it's strange to hit this 
issue because we shouldn't be changing the table location when altering table 
properties. Could you check the table location on Hive side to see if it's 
under the hive warehouse root? And have you upgraded your HMS after this table 
was created?

> Alter table fails on Hive catalog
> ---------------------------------
>
>                 Key: FLINK-16402
>                 URL: https://issues.apache.org/jira/browse/FLINK-16402
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Hive, Table SQL / Client
>    Affects Versions: 1.10.0
>            Reporter: Gyula Fora
>            Priority: Major
>
> Hive version: 3.1.0
> I get the following error when trying to execute a simple alter table 
> statement:
>  
> {code:java}
> ALTER TABLE ItemTransactions 
> SET (
>  'connector.properties.bootstrap.servers' = 'gyula-1.gce.cloudera.com:9092'
> );
> {code}
> {code:java}
> Caused by: org.apache.flink.table.api.TableException: Could not execute ALTER 
> TABLE hive.default.ItemTransactions SET 
> (connector.properties.zookeeper.connect: [dummy], connector.version: 
> [universal], format.schema: [ROW(transactionId LONG, ts LONG, itemId STRING, 
> quantity INT)], connector.topic: [transaction.log.1], is_generic: [true], 
> connector.startup-mode: [earliest-offset], connector.type: [kafka], 
> connector.properties.bootstrap.servers: [gyula-1.gce.cloudera.com:9092], 
> connector.properties.group.id: [testGroup], format.type: [json])Caused by: 
> org.apache.flink.table.api.TableException: Could not execute ALTER TABLE 
> hive.default.ItemTransactions SET (connector.properties.zookeeper.connect: 
> [dummy], connector.version: [universal], format.schema: [ROW(transactionId 
> LONG, ts LONG, itemId STRING, quantity INT)], connector.topic: 
> [transaction.log.1], is_generic: [true], connector.startup-mode: 
> [earliest-offset], connector.type: [kafka], 
> connector.properties.bootstrap.servers: [gyula-1.gce.cloudera.com:9092], 
> connector.properties.group.id: [testGroup], format.type: [json]) at 
> org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlUpdate(TableEnvironmentImpl.java:545)
>  at 
> org.apache.flink.table.api.java.internal.StreamTableEnvironmentImpl.sqlUpdate(StreamTableEnvironmentImpl.java:331)
>  at 
> org.apache.flink.table.client.gateway.local.LocalExecutor.lambda$applyUpdate$17(LocalExecutor.java:690)
>  at 
> org.apache.flink.table.client.gateway.local.ExecutionContext.wrapClassLoader(ExecutionContext.java:240)
>  at 
> org.apache.flink.table.client.gateway.local.LocalExecutor.applyUpdate(LocalExecutor.java:688)
>  ... 9 moreCaused by: 
> org.apache.flink.table.catalog.exceptions.CatalogException: Failed to rename 
> table default.ItemTransactions at 
> org.apache.flink.table.catalog.hive.HiveCatalog.alterTable(HiveCatalog.java:433)
>  at 
> org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlUpdate(TableEnvironmentImpl.java:537)
>  ... 13 moreCaused by: MetaException(message:A managed table's location needs 
> to be under the hive warehouse root 
> directory,table:ItemTransactions,location:/warehouse/tablespace/external/hive/itemtransactions,Hive
>  warehouse:/warehouse/tablespace/managed/hive) at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_req_result$alter_table_req_resultStandardScheme.read(ThriftHiveMetastore.java)
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to