question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Presto fails to write to Iceberg tables

See original GitHub issue

Presto 0.254.1 Hive 2.3.8

presto:iceberg_test> create table person (name varchar, age int, id int) with (location = 'file:///home/dbw/testdb/person5/', format = 'parquet');
CREATE TABLE
presto:iceberg_test> insert into person values ('alice', 18, 1000);

Query 20210610_120138_00057_g5t6w, FAILED, 1 node
Splits: 19 total, 17 done (89.47%)
0:02 [0 rows, 0B] [0 rows/s, 0B/s]

Query 20210610_120138_00057_g5t6w failed: org.apache.parquet.schema.Types$PrimitiveBuilder.as(Lorg/apache/parquet/schema/LogicalTypeAnnotation;)Lorg/apache/parquet/schema/Types$Builder;

Error stack

2021-06-10T20:01:40.447+0800    ERROR   remote-task-callback-43 com.facebook.presto.execution.StageExecutionStateMachine        Stage execution 20210610_120138_00057_g5t6w.1.0 failed
java.lang.NoSuchMethodError: org.apache.parquet.schema.Types$PrimitiveBuilder.as(Lorg/apache/parquet/schema/LogicalTypeAnnotation;)Lorg/apache/parquet/schema/Types$Builder;
        at org.apache.iceberg.parquet.TypeToMessageType.primitive(TypeToMessageType.java:145)
        at org.apache.iceberg.parquet.TypeToMessageType.field(TypeToMessageType.java:88)
        at org.apache.iceberg.parquet.TypeToMessageType.convert(TypeToMessageType.java:65)
        at org.apache.iceberg.parquet.ParquetSchemaUtil.convert(ParquetSchemaUtil.java:41)
        at com.facebook.presto.iceberg.IcebergFileWriterFactory.createParquetWriter(IcebergFileWriterFactory.java:114)
        at com.facebook.presto.iceberg.IcebergFileWriterFactory.createFileWriter(IcebergFileWriterFactory.java:77)
        at com.facebook.presto.iceberg.IcebergPageSink.createWriter(IcebergPageSink.java:303)
        at com.facebook.presto.iceberg.IcebergPageSink.getWriterIndexes(IcebergPageSink.java:284)
        at com.facebook.presto.iceberg.IcebergPageSink.writePage(IcebergPageSink.java:212)
        at com.facebook.presto.iceberg.IcebergPageSink.doAppend(IcebergPageSink.java:207)
        at com.facebook.presto.iceberg.IcebergPageSink.lambda$appendPage$0(IcebergPageSink.java:146)
        at com.facebook.presto.hive.authentication.HdfsAuthentication.lambda$doAs$0(HdfsAuthentication.java:24)
        at com.facebook.presto.hive.authentication.NoHdfsAuthentication.doAs(NoHdfsAuthentication.java:23)
        at com.facebook.presto.hive.authentication.HdfsAuthentication.doAs(HdfsAuthentication.java:23)
        at com.facebook.presto.hive.HdfsEnvironment.doAs(HdfsEnvironment.java:86)
        at com.facebook.presto.iceberg.IcebergPageSink.appendPage(IcebergPageSink.java:146)
        at com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorPageSink.appendPage(ClassLoaderSafeConnectorPageSink.java:66)
        at com.facebook.presto.operator.TableWriterOperator.addInput(TableWriterOperator.java:324)
        at com.facebook.presto.operator.Driver.processInternal(Driver.java:428)
        at com.facebook.presto.operator.Driver.lambda$processFor$9(Driver.java:301)
        at com.facebook.presto.operator.Driver.tryWithLock(Driver.java:722)
        at com.facebook.presto.operator.Driver.processFor(Driver.java:294)
        at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1077)
        at com.facebook.presto.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:162)
        at com.facebook.presto.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:545)
        at com.facebook.presto.$gen.Presto_0_254_1_a67de6c____20210610_114751_1.run(Unknown Source)
        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)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
beinancommented, Jun 16, 2021

looks like a couple of the table_params including table-type dropped after any insert

  1 | metadata_location          | file:///Users/beinan/w/tmp/metadata/000

01-6bd8b56b-a589-4003-babd-89591b793bd5.metadata.json 1 | previous_metadata_location | file:///Users/beinan/w/tmp/metadata/000 00-3023be96-f8b0-408f-b250-fe6f3a27b674.metadata.json 1 | transient_lastDdlTime | 1623823254 1 | totalSize | 0 1 | numFiles | 0 2 | totalSize | 0 2 | numFiles | 0 2 | metadata_location | file:///Users/beinan/w/tmp/metadata/000 01-2eab1433-d38e-43a2-862f-c52bd4896aa1.metadata.json 2 | previous_metadata_location | file:///Users/beinan/w/tmp/metadata/000 00-edf1393b-d9ba-4a10-8393-d5bc10c7bfa7.metadata.json 2 | transient_lastDdlTime | 1623823996 3 | metadata_location | file:///Users/beinan/w/tmp/metadata/000 00-d9db195c-3fb4-4bea-8fed-b3f5481900bc.metadata.json 3 | totalSize | 0 3 | table_type | iceberg 3 | numFiles | 0 3 | EXTERNAL | TRUE

I will post a PR to fix this issue very soon

1reaction
beinancommented, Jun 10, 2021

Good catch, thank you @dbw9580 ! I guess it’s caused by a class conflict from different versions of the parquet library.

This PR https://github.com/prestodb/presto-hive-apache/pull/47 might fix the issue. @aweisberg and I are making the release now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Iceberg Connector — Presto 0.278 Documentation
The Iceberg connector allows querying data stored in Iceberg tables. ... The maximum number of partitions handled per writer.
Read more >
Spark Writes - Apache Iceberg
When writing with the v1 DataFrame API in Spark 3, use saveAsTable or insertInto to load tables with a catalog. Using format("iceberg") loads...
Read more >
Running Presto on Iceberg Tables with Alluxio
Note: there was a bug in the write path of Presto's Iceberg connector, so insertion may fail. This issue has been resolved in...
Read more >
Presto and Apache Iceberg - Chunxu Tang, Twitter - YouTube
Presto and Apache Iceberg - Chunxu Tang, TwitterApache Iceberg is an open table format for huge analytic datasets. At Twitter, engineers are ...
Read more >
Iceberg connector — Trino 403 Documentation
Trino does not offer view redirection support. The connector supports redirection from Iceberg tables to Hive tables with the iceberg.hive-catalog-name ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found