forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix](planner) fix create view star except and modify cast to sql (ap…
- Loading branch information
1 parent
0b414ba
commit 01c06f3
Showing
7 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
regression-test/data/view_p0/create_view_star_except_and_cast_to_sql.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !test_select_star_except -- | ||
1 1 | ||
2 1 | ||
3 5 | ||
4 5 | ||
6 \N | ||
|
||
-- !test_sql -- | ||
v_mal_old_create_view2 CREATE VIEW `v_mal_old_create_view2` COMMENT 'VIEW' AS SELECT CAST(CAST(`a` AS TEXT) AS TIME(0)) AS `__cast_expr_0` FROM `regression_test_view_p0`.`mal_old_create_view`; utf8mb4 utf8mb4_0900_bin | ||
|
45 changes: 45 additions & 0 deletions
45
regression-test/suites/view_p0/create_view_star_except_and_cast_to_sql.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
suite("create_view_star_except_and_cast_to_sql") { | ||
sql "SET enable_nereids_planner=false;" | ||
|
||
sql """ | ||
DROP TABLE IF EXISTS mal_old_create_view | ||
""" | ||
sql """ | ||
create table mal_old_create_view(pk int, a int, b int) distributed by hash(pk) buckets 10 | ||
properties('replication_num' = '1'); | ||
""" | ||
|
||
sql """ | ||
insert into mal_old_create_view values(2,1,3),(1,1,2),(3,5,6),(6,null,6),(4,5,6); | ||
""" | ||
sql "sync" | ||
sql "drop view if EXISTS v_mal_old_create_view" | ||
|
||
sql "create view v_mal_old_create_view as select * except(a) from mal_old_create_view" | ||
|
||
qt_test_select_star_except "select * from v_mal_old_create_view order by pk,b" | ||
|
||
sql "drop view if EXISTS v_mal_old_create_view2" | ||
|
||
sql "create view v_mal_old_create_view2 as select cast(cast(a as string) as time) from mal_old_create_view" | ||
qt_test_sql "show create view v_mal_old_create_view2" | ||
sql "select * from v_mal_old_create_view2" | ||
|
||
} |