-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](Nereids) null type in result set will be cast to tinyint (#37019)
- Loading branch information
Showing
4 changed files
with
100 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select -- | ||
\N | ||
|
||
-- !desc -- | ||
test_create_with_null_type DUP_KEYS __cast_0 TINYINT TINYINT Yes true \N true | ||
|
64 changes: 64 additions & 0 deletions
64
regression-test/suites/mtmv_p0/test_create_with_null_type.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,64 @@ | ||
// 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. | ||
|
||
import org.junit.Assert; | ||
|
||
suite("test_create_with_null_type") { | ||
def tableName = "t_test_create_with_null_type" | ||
def mvName = "test_create_with_null_type" | ||
def dbName = "regression_test_mtmv_p0" | ||
sql """drop table if exists `${tableName}`""" | ||
sql """drop materialized view if exists ${mvName};""" | ||
|
||
sql """ | ||
CREATE TABLE `${tableName}` ( | ||
`user_id` LARGEINT NOT NULL COMMENT '\"用户id\"', | ||
`num` SMALLINT SUM NOT NULL COMMENT '\"数量\"' | ||
) ENGINE=OLAP | ||
AGGREGATE KEY(`user_id`) | ||
COMMENT 'OLAP' | ||
DISTRIBUTED BY HASH(`user_id`) BUCKETS 2 | ||
PROPERTIES ('replication_num' = '1') ; | ||
""" | ||
sql """ | ||
insert into ${tableName} values (1,1),(1,2); | ||
""" | ||
|
||
sql """ | ||
CREATE MATERIALIZED VIEW ${mvName} | ||
BUILD DEFERRED REFRESH AUTO ON MANUAL | ||
DISTRIBUTED BY RANDOM BUCKETS 2 | ||
PROPERTIES ('replication_num' = '1') | ||
AS | ||
SELECT null FROM ${tableName}; | ||
""" | ||
|
||
sql """ | ||
REFRESH MATERIALIZED VIEW ${mvName} AUTO; | ||
""" | ||
|
||
def jobName = getJobName(dbName, mvName); | ||
log.info(jobName) | ||
waitingMTMVTaskFinished(jobName) | ||
|
||
order_qt_select "SELECT * FROM ${mvName}" | ||
|
||
qt_desc "desc ${mvName} all" | ||
|
||
sql """drop table if exists `${tableName}`""" | ||
sql """drop materialized view if exists ${mvName};""" | ||
} |