Commit 3a154a2
authored
[fix](nereids) fix create view use null literal (#49881)
Related PR: #32743
Problem Summary:
problem before this pr:
1. null type problem
the type of NULL is null_type, this will lead to error when select this view through jdbc catalog.
```sql
mysql> CREATE VIEW test_null COMMENT '测试null类型' AS SELECT NULL AS `col1`;
Query OK, 0 rows affected (0.02 sec)
mysql> desc test_null;
+-------+-----------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+-------+---------+-------+
| col1 | null_type | Yes | false | NULL | |
+-------+-----------+------+-------+---------+-------+
1 row in set (0.00 sec)
```
after this pr, the type is changed to tinyint.
mysql> CREATE VIEW test_null2 COMMENT '测试null类型' AS SELECT NULL AS `col1`;
Query OK, 0 rows affected (0.03 sec)
```sql
mysql> desc test_null2;
+-------+---------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-------+---------+-------+
| col1 | tinyint | Yes | false | NULL | |
+-------+---------+------+-------+---------+-------+
1 row in set (0.01 sec)
```
2. nullable problem
Modify the internal elements of nested types returned by JDBC to always be null, in order to maintain consistency with Doris' internal implementation
### Release note1 parent 01725e5 commit 3a154a2
File tree
4 files changed
+79
-7
lines changed- fe
- be-java-extensions/java-common/src/main/java/org/apache/doris/common/jni/vec
- fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info
- regression-test
- data/ddl_p0/create_view_nereids
- suites/ddl_p0/create_view_nereids
4 files changed
+79
-7
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
1239 | | - | |
| 1239 | + | |
1240 | 1240 | | |
1241 | 1241 | | |
1242 | 1242 | | |
| |||
1300 | 1300 | | |
1301 | 1301 | | |
1302 | 1302 | | |
1303 | | - | |
1304 | | - | |
| 1303 | + | |
| 1304 | + | |
1305 | 1305 | | |
1306 | 1306 | | |
1307 | 1307 | | |
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | | - | |
| 1366 | + | |
1367 | 1367 | | |
1368 | 1368 | | |
1369 | 1369 | | |
| |||
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
165 | | - | |
166 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
174 | 182 | | |
175 | | - | |
| 183 | + | |
176 | 184 | | |
177 | 185 | | |
178 | 186 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments