LuciferYang opened a new issue, #10616:
URL: https://github.com/apache/paimon/issues/10616

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   ### Paimon version
   
   master (5d019f5a6d)
   
   ### Compute Engine
   
   Flink 2.1 / 2.2
   
   ### Minimal reproduce step
   
   ```sql
   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?
   
   - [X] I'm willing to submit a PR!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to