-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iceberg queries stuck in the planning phase for long time #23451
Comments
This could be related to #23384 |
We will release a new Trino version this week. I'll postpone further investigation so we can check whether the fix in this new version helps. |
@wendigo We tested Trino version 458, and while the planning time has improved, it remains unusually high, ranging between 30 to 50 seconds. |
@sriharshaj do you know what accounts for this number? Metadata retrieval from storage? Metastore calls? |
Here are the optimizer summaries.
Is there a way to analyze why the optimizers are taking so long? Additionally, where can I find details on metadata retrieval and Metastore calls? |
@sriharshaj You can enable tracing (opentelemetry) and capture what cluster is doing |
@wendigo Can I capture those metrics with JMX? We don't have opentelemetry setup. |
@sriharshaj jmx keeps aggregates, not individual events |
@wendigo I installed Trino locally and ran the same query. The planning phase took approximately 15 seconds. The During query optimization in Trino, metadata is being fetched five times, and during the fragment generation phase, it’s being retrieved three additional times. |
This issue occurs exclusively with Iceberg queries. For Hive, everything works as expected. |
@sriharshaj I believe that @raunaqmorarka added recently some cache for metadata files. |
What's the version you are using? @sriharshaj |
@wendigo We are facing this issue since 451. I traced down the issue to this change: https://github.com/trinodb/trino/pull/15712/files#diff-e1cb17efec6787989f9df9ee40c4f2809ff3fe946cd2ec721ff8932b131997b8R618. Our schema contains a large number of nested fields, which results in all columns being mapped to |
@krvikash @raunaqmorarka can you take a look? |
Thank you, @wendigo, for your guidance in helping me identify the issue. |
@krvikash @raunaqmorarka Any updates? |
Hi @sriharshaj, I did not get a chance to looked into yet. I will take a look in this week. |
Hi @sriharshaj, opened #23586 to load only required columns in the map. If you have a way to try this change before merge and see if this fix reduce the planning time for your query. |
@krvikash Sure, I will try this fix today. |
@krvikash I tried the fix, it worked. Planning time is in milliseconds. Thank you for the fix. |
Great!! Thanks @sriharshaj for reporting this and verifying the fix. |
Our Iceberg queries are getting stuck in the planning phase for 2 to 3 minutes, although they eventually run successfully. We are currently upgrading Trino from version 444 to 454. This issue has been occurring since Trino version 451 (we went back and tried different versions).
Our Iceberg stack -->
Storage: s3
File format: parquet
Catalog: Hive
Query explain:
Query info:
https://gist.github.com/sriharshaj/f26e655f233b84754da8216be2ae0172
The text was updated successfully, but these errors were encountered: