Archon
Archon

Reputation: 1477

Presto CLI call system.create_empty_partition() ERROR

Environment

Hive Table created by Presto

CREATE TABLE hive.origin.test_part (
    id int,
    date_key int
)
WITH (
    format = 'ORC',
    partitioned_by = ARRAY['date_key'],
    external_location = '/user/hive/warehouse/origin.db/test_part/'
)

Presto JDBC and CLI both insert into success

partiton '20190122' doesn't exist before and insert succeeded which means rename tmp directory to /user/hive/warehouse/origin.db/test_part/date_key=20190122 succeeded.

enter image description here

/user/hive/warehouse/origin.db/test_part/date_key=20190122/ in hdfs

enter image description here

But Presto CLI CALL system.create_empty_partition() failed

CALL system.create_empty_partition( schema_name => 'origin', table_name => 'test_part', partition_columns => ARRAY['date_key'], partition_values => ARRAY['20190121'])

enter image description here

Full error message

com.facebook.presto.spi.PrestoException: Failed to rename hdfs://datacenter1:8020/tmp/presto-hive/b87162e5-9e48-4d43-a0e7-ecf0994fe625/date_key=20190121 to hdfs://datacenter1:8020/user/hive/warehouse/origin.db/test_part/date_key=20190121: rename returned false
    at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore.renameDirectory(SemiTransactionalHiveMetastore.java:1787)
    at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore.access$2700(SemiTransactionalHiveMetastore.java:87)
    at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore$Committer.prepareAddPartition(SemiTransactionalHiveMetastore.java:1177)
    at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore$Committer.access$700(SemiTransactionalHiveMetastore.java:957)
    at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore.commitShared(SemiTransactionalHiveMetastore.java:885)
    at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore.commit(SemiTransactionalHiveMetastore.java:807)
    at com.facebook.presto.hive.HiveMetadata.commit(HiveMetadata.java:1949)
    at com.facebook.presto.hive.CreateEmptyPartitionProcedure.createEmptyPartition(CreateEmptyPartitionProcedure.java:126)
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:649)
    at com.facebook.presto.execution.CallTask.execute(CallTask.java:160)
    at com.facebook.presto.execution.CallTask.execute(CallTask.java:60)
    at com.facebook.presto.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:168)
    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:748)

/tmp/presto-hive/ in hdfs

enter image description here

So

CALL system.create_empty_partition() use different 'user' to manipulate hdfs?

Upvotes: 0

Views: 802

Answers (1)

David Phillips
David Phillips

Reputation: 10208

This is failing due to a bug that prevents it from working with non-bucketed tables. It is fixed in the 301 release.

Upvotes: 5

Related Questions