Skip to content
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

Some queries are failing with java.lang.IllegalArgumentException: compacted dictionary should not have dictionary base block after upgrading to Trino 370 #11080

Closed
isharamet opened this issue Feb 17, 2022 · 1 comment · Fixed by #11145
Assignees
Labels
bug Something isn't working

Comments

@isharamet
Copy link

isharamet commented Feb 17, 2022

After upgrading from 360 to 370 some of the queries start failing with the following issue:

java.lang.IllegalArgumentException: compacted dictionary should not have dictionary base block
	at io.trino.spi.block.DictionaryBlock.<init>(DictionaryBlock.java:107)
	at io.trino.spi.block.DictionaryBlock.<init>(DictionaryBlock.java:80)
	at io.trino.spi.block.DictionaryBlock.<init>(DictionaryBlock.java:75)
	at io.trino.spi.Page.compactRelatedBlocks(Page.java:254)
	at io.trino.spi.Page.compact(Page.java:190)
	at io.trino.operator.exchange.PartitioningExchanger.accept(PartitioningExchanger.java:68)
	at io.trino.operator.exchange.LocalExchangeSink.addPage(LocalExchangeSink.java:74)
	at io.trino.operator.exchange.LocalExchangeSinkOperator.addInput(LocalExchangeSinkOperator.java:153)
	at io.trino.operator.Driver.processInternal(Driver.java:393)
	at io.trino.operator.Driver.lambda$processFor$9(Driver.java:292)
	at io.trino.operator.Driver.tryWithLock(Driver.java:682)
	at io.trino.operator.Driver.processFor(Driver.java:285)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1092)
	at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:163)
	at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:488)
	at io.trino.$gen.Trino_370____20220214_025204_2.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

I'll try to provide an example without exposing much details, but for now - these are complex queries containing multiple with clauses, joins and window aggregations.

This is the final part of the query:

...
SELECT
    user_id
    , a
    , start_dt
    ...
    , day_id
    , week_id
    , month_id
    , aa as aaa
    , bb as bbb
    , MAX(aa) OVER(PARTITION BY user_id , a, start_dt, week_id) AS aa_week
    , MAX(bb) OVER(PARTITION BY user_id ,a, start_dt, week_id) AS bb_week
    , MAX(aa) OVER(PARTITION BY user_id, a, start_dt, month_id) AS aa_month
    , MAX(bb) OVER(PARTITION BY user_id, a, start_dt, month_id) AS bb_month
FROM check_retention

and it doesn't throw an error being modified in this way:

...
SELECT
    user_id
    , a
    , start_dt
    ...
    , day_id
    , week_id
    , month_id
    , aa as aaa
    , bb as bbb
--    , MAX(aa) OVER(PARTITION BY user_id , a, start_dt, week_id) AS aa_week
--    , MAX(bb) OVER(PARTITION BY user_id ,a, start_dt, week_id) AS bb_week
    , MAX(aa) OVER(PARTITION BY user_id, a, start_dt, month_id) AS aa_month
    , MAX(bb) OVER(PARTITION BY user_id, a, start_dt, month_id) AS bb_month
FROM check_retention

or this way:

...
SELECT
    user_id
    , a
    , start_dt
    ...
    , day_id
    , week_id
    , month_id
    , aa as aaa
    , bb as bbb
    , MAX(aa) OVER(PARTITION BY user_id , a, start_dt, week_id) AS aa_week
    , MAX(bb) OVER(PARTITION BY user_id ,a, start_dt, week_id) AS bb_week
--    , MAX(aa) OVER(PARTITION BY user_id, a, start_dt, month_id) AS aa_month
--    , MAX(bb) OVER(PARTITION BY user_id, a, start_dt, month_id) AS bb_month
FROM check_retention
@findepi
Copy link
Member

findepi commented Feb 18, 2022

cc @sopel39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants