adonis0147 opened a new issue, #9808:
URL: https://github.com/apache/incubator-doris/issues/9808

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Description
   
   This issue is a subtask of 
https://github.com/apache/incubator-doris/issues/7570 .
   
   It proposes an approach to distinguish two array types:
   1. An array type which doesn't contain null values.
   2. An array type which contains null values.
   
   Some other softwares have similar features.
   
   **ClickHouse**
   See 
[Array(t)](https://clickhouse.com/docs/en/sql-reference/data-types/array/)
   
   Examples:
   1. Array(UInt8)
   2. Array(Nullable(UInt8))
   
   **Spark**
   See 
[ArrayType](https://sparkbyexamples.com/spark/spark-array-arraytype-dataframe-column)
   
   Examples:
   1. DataTypes.createArrayType(StringType)
   2. DataTypes.createArrayType(StringType, false) - `false` here indicates the 
type doesn't contain null values.
   
   ## Proposed syntax
   1. ```ARRAY<TYPE>``` - contains null by default (behaves like Spark and 
Postgres)
   2. ```ARRAY<NOT_NULL(TYPE)>``` - doesn't contain null
   
   ### Use case
   
   ```shell
   mysql> create table array_type_table(k1 INT, k2 Array<not_null(int)>) 
duplicate key (k1)
       -> distributed by hash(k1) buckets 1 properties('replication_num' = '1');
   ```
   
   ### Related issues
   
   #7570
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to