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

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

Hi [~morhidi], thanks for the clarifications. I'm still not sure why the issue 
happened. When {{HiveCatalog}} creates a table, it doesn't set the table 
location, which means the location should be set on HMS side. Then when 
{{HiveCatalog}} alters properties of a table, it doesn't touch the location 
either. So everything should be fine as long as HMS sets a correct location in 
the first place. It does remind me of [an 
issue|https://issues.apache.org/jira/browse/HIVE-22158?focusedCommentId=16971481&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16971481]
 I hit myself. Not sure whether it's related but it might be helpful to take a 
look.

Besides, please be noted that the highest hive version supported by the hive 
connector is 3.1.2, and we haven't tested beyond that version. So in general, 
if you cherry-pick newer features it's likely to lead to problems.

> 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