Skip to content

[Bug] Flink VARIANT NOT NULL column is stored as nullable #10616

Closed

Description

@LuciferYang

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master (5d019f5)

Compute Engine

Flink 2.1 / 2.2

Minimal reproduce step

CREATE TABLE t (id INT, v VARIANT NOT NULL);
INSERT INTO t VALUES (1, CAST(NULL AS VARIANT));
SELECT * FROM t;

What doesn't meet your expectations?

The insert succeeds and the table holds a NULL in a column declared NOT NULL. LogicalTypeToDataType.visit(VariantType) always creates a nullable Paimon VariantType, so the NOT NULL constraint is not stored, Flink reads the column back as nullable and does not enforce it, and other engines see a nullable column too.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions