zhangyue19921010 opened a new issue, #11311:
URL: https://github.com/apache/paimon/issues/11311
### Search before asking
- [x] I searched in the issues and found nothing similar.
### Paimon version
master at 71082ea86a57930f3fa00bb74f60d0a5dd676e35 (2.2-SNAPSHOT).
### Compute Engine
Spark 3.5.9, Scala 2.12, JDK 11.
### Minimal reproduce step
Create an ordinary append table with a complex default containing NULL:
```sql
CREATE TABLE t (
id INT,
a ARRAY<INT> DEFAULT ARRAY(1, NULL)
) USING paimon;
```
Creation fails with `Unsupported default value ARRAY(1, NULL)` because the
cast rule tries to parse `NULL` as an integer. The same happens with `MAP(1,
NULL)` and `STRUCT(1, NULL)` defaults. `ARRAY<INT> DEFAULT NULL` and `STRUCT<b:
INT> DEFAULT NULL` are also rejected by their respective cast rules.
### What doesn't meet your expectations?
NULL is a case-insensitive SQL literal. These defaults should allow the
table to be created and fill omitted values with the expected null element, map
value, struct field or whole value.
### Anything else?
The complex cast rules recognize only lowercase nested `null`. ARRAY and ROW
also lack the whole-value NULL handling already used by MAP. Recognizing NULL
consistently while retaining the tokenizer's literal flag preserves quoted or
escaped strings such as `"NULL"`.
### 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]