[
https://issues.apache.org/jira/browse/FLINK-40849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128357#comment-18128357
]
Charan Rathore commented on FLINK-40849:
----------------------------------------
Thanks, dylanhz. I’m working on a fix for the UNION ALL case where RAW/BITMAP
columns have the same underlying type but different nullability. The nullable
side should be accepted and the union result should be nullable, rather than
falling through to Calcite’s OTHER assignment rules. The issue’s values-table
reproducer currently fails with `AssertionError: No assign rules for OTHER
defined`. I would add regression coverage for both BITMAP and RAW with a
nullability mismatch. Does this compatibility check look like the right place
to handle it?
> UNION ALL fails for RAW/BITMAP columns with different nullability
> -----------------------------------------------------------------
>
> Key: FLINK-40849
> URL: https://issues.apache.org/jira/browse/FLINK-40849
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Reporter: dylanhz
> Priority: Major
>
> h2. Description
> UNION ALL fails when corresponding RAW or BITMAP columns differ only in
> nullability, throwing {{AssertionError: No assign rules for OTHER defined}}.
> h2. Reproducer
> Using Flink's test {{values}} connector:
> {code:sql}
> CREATE TABLE t (
> a BITMAP NOT NULL,
> b BITMAP
> ) WITH ('connector' = 'values', 'bounded' = 'true');
> SELECT a FROM t
> UNION ALL
> SELECT b FROM t;
> {code}
> Expected: validation succeeds with a nullable BITMAP result.
> Actual: validation throws the assertion above. The same issue occurs for RAW
> columns with identical class and serializer.
> h2. Cause
> Different nullability prevents Flink's identical-type shortcut from applying.
> Calcite then falls back to conversion checks, but RAW and BITMAP use
> {{SqlTypeName.OTHER}}, which has no entry in the default assignment rules.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)