trinodb/trino

Fix hive4 tests failing with `location must not be root path`

mayankvadariya opened this issue · 1 comments

Fix certain tests failing with location must not be root path in TestHive4OnDataLake.

Caused by: io.trino.hive.thrift.metastore.InvalidObjectException: test_sync_partition_on_bucket_root_39h7u99fo2 location must not be root path
	at io.trino.hive.thrift.metastore.ThriftHiveMetastore$create_table_result$create_table_resultStandardScheme.read(ThriftHiveMetastore.java:60697)
	at io.trino.hive.thrift.metastore.ThriftHiveMetastore$create_table_result$create_table_resultStandardScheme.read(ThriftHiveMetastore.java:60673)
	at io.trino.hive.thrift.metastore.ThriftHiveMetastore$create_table_result.read(ThriftHiveMetastore.java:60598)
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:93)
	at io.trino.hive.thrift.metastore.ThriftHiveMetastore$Client.recvCreateTable(ThriftHiveMetastore.java:1535)
	at io.trino.hive.thrift.metastore.ThriftHiveMetastore$Client.createTable(ThriftHiveMetastore.java:1522)
	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastoreClient.createTable(ThriftHiveMetastoreClient.java:240)
	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.lambda$createTable$31(ThriftHiveMetastore.java:846)
	at io.trino.plugin.hive.metastore.thrift.ThriftMetastoreApiStats.lambda$wrap$0(ThriftMetastoreApiStats.java:41)
	at io.trino.plugin.hive.util.RetryDriver.run(RetryDriver.java:117)
	at io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore.createTable(ThriftHiveMetastore.java:844)

this is something we should report to Hive folks instead and get them to fix properly.

Instead of fixing bug where DROP TABLE on root location threw NPE they simply disallowed creating such tables. That doesn't even help since people can have already existing tables pointing to root locations.

See https://issues.apache.org/jira/browse/HIVE-25912 + apache/hive#3009