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

Partial aggregation over long decimals fails if pushed below join #21099

Closed
findepi opened this issue Mar 15, 2024 · 1 comment · Fixed by #21083
Closed

Partial aggregation over long decimals fails if pushed below join #21099

findepi opened this issue Mar 15, 2024 · 1 comment · Fixed by #21083
Labels
bug Something isn't working

Comments

@findepi
Copy link
Member

findepi commented Mar 15, 2024

Query failed: class io.trino.spi.block.DictionaryBlock cannot be cast to class io.trino.spi.block.VariableWidthBlock

Caused by: java.lang.ClassCastException: class io.trino.spi.block.DictionaryBlock cannot be cast to class io.trino.spi.block.VariableWidthBlock (io.trino.spi.block.DictionaryBlock and io.trino.spi.block.VariableWidthBlock are in unnamed module of loader 'app')
 	at io.trino.operator.aggregation.state.LongDecimalWithOverflowStateSerializer.deserialize(LongDecimalWithOverflowStateSerializer.java:67)
 	at io.trino.operator.aggregation.state.LongDecimalWithOverflowStateSerializer.deserialize(LongDecimalWithOverflowStateSerializer.java:26)
 	at io.trino.$gen.sumGroupedAccumulator_20240313_131249_42.addIntermediate(Unknown Source)
 	at io.trino.operator.aggregation.GroupedAggregator.processPage(GroupedAggregator.java:93)
 	at io.trino.operator.aggregation.builder.InMemoryHashAggregationBuilder.lambda$processPage$1(InMemoryHashAggregationBuilder.java:157)
 	at io.trino.operator.TransformWork.process(TransformWork.java:44)
 	at io.trino.operator.HashAggregationOperator.addInput(HashAggregationOperator.java:443)
 	at io.trino.operator.Driver.processInternal(Driver.java:400)
@findepi findepi added the bug Something isn't working label Mar 15, 2024
@findepi
Copy link
Member Author

findepi commented Mar 15, 2024

this is apparently a regression in 440 (#19816)

can be reproduced

Session session = Session.builder(assertions.getDefaultSession())
        .setSystemProperty(PUSH_PARTIAL_AGGREGATION_THROUGH_JOIN, "true")
        .build();
assertThat(assertions.query(session, """
        SELECT l.i, sum(v)
        FROM (VALUES 1, 2, 2, 3, 3, 3) l(i)
        JOIN (VALUES
            (1, DECIMAL '12345678901234567890.1234567890'),
            (1, DECIMAL '11111111111111111111.1234567890'),
            (2, DECIMAL '22222222222222222222.1234567890'),
            (3, DECIMAL '33333333333333333333.1234567890'),
            (7, DECIMAL '77777777777777777777.1234567890')) r(i, v) ON l.i = r.i
        GROUP BY l.i
        """))
        .matches("""
                VALUES
                    (1, CAST(DECIMAL '23456790012345679001.2469135780' AS decimal(38, 10))),
                    (2, CAST(DECIMAL '44444444444444444444.2469135780' AS decimal(38, 10))),
                    (3, CAST(DECIMAL '99999999999999999999.3703703670' AS decimal(38, 10)))
                """);

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.

1 participant