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

Iceberg query fails with multiple nested partition columns #24628

Open
jinyangli34 opened this issue Jan 4, 2025 · 1 comment · May be fixed by #24629
Open

Iceberg query fails with multiple nested partition columns #24628

jinyangli34 opened this issue Jan 4, 2025 · 1 comment · May be fixed by #24629
Labels
bug Something isn't working RELEASE-BLOCKER

Comments

@jinyangli34
Copy link
Contributor

can be reproduced with example query in error message below.
Issue seems introduced in 468 with new bucket execution. (passed in 467)

Suppressed: java.lang.Exception: SQL: CREATE TABLE test_partition_columns_f1wsd6bhrn WITH (partitioning = ARRAY[
    '"r1.f1"',
    'bucket(b1, 4)'
]) AS
SELECT
    CAST('c1' AS VARCHAR) as c1
    , CAST(ROW(1, 2) AS ROW(f1 integer, f2 integer)) as r1
    , CAST('2022-01-01 01:01:01' AS TIMESTAMP) as d1
    , CAST('2022-01-01 01:01:01' AS TIMESTAMP) as d2
    , CAST('2022-01-01 01:01:01' AS TIMESTAMP) as d3
    , CAST('2022-01-01 01:01:01' AS TIMESTAMP) as d4
    , CAST('b' AS VARCHAR) as b1
    , CAST('12345678' AS VARCHAR) as t1
		at io.trino.testing.DistributedQueryRunner.executeInternal(DistributedQueryRunner.java:572)
		... 11 more
Caused by: java.lang.ClassCastException: class io.trino.spi.block.VariableWidthBlock cannot be cast to class io.trino.spi.block.RowBlock (io.trino.spi.block.VariableWidthBlock and io.trino.spi.block.RowBlock are in unnamed module of loader 'app')
	at io.trino.plugin.iceberg.IcebergBucketFunction$HashFunction.getValue(IcebergBucketFunction.java:124)
	at io.trino.plugin.iceberg.IcebergBucketFunction$HashFunction.computeHash(IcebergBucketFunction.java:131)
	at io.trino.plugin.iceberg.IcebergBucketFunction.getBucket(IcebergBucketFunction.java:74)
	at io.trino.operator.BucketPartitionFunction.getPartition(BucketPartitionFunction.java:46)
	at io.trino.operator.output.SkewedPartitionFunction.getPartition(SkewedPartitionFunction.java:47)
	at io.trino.operator.output.PagePartitioner.partitionPageByRow(PagePartitioner.java:258)
	at io.trino.operator.output.PagePartitioner.partitionPage(PagePartitioner.java:146)
	at io.trino.operator.output.PartitionedOutputOperator.addInput(PartitionedOutputOperator.java:337)
        public Object getValue(Page page, int position)
        {
            Block block = page.getBlock(dataPath.getFirst());
            for (int i = 1; i < dataPath.size(); i++) {
                position = block.getUnderlyingValuePosition(position);
                block = ((RowBlock) block.getUnderlyingValueBlock()).getFieldBlock(dataPath.get(i));
            }
            return valueTransform.apply(block, position);
        }
@findinpath
Copy link
Contributor

cc @dain @raunaqmorarka

@raunaqmorarka raunaqmorarka added bug Something isn't working RELEASE-BLOCKER labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working RELEASE-BLOCKER
Development

Successfully merging a pull request may close this issue.

3 participants