[fix](planner) fix now function param type error (#23446)

This commit is contained in:
Siyang Tang
2023-08-25 00:12:21 +08:00
committed by GitHub
parent 71071ba057
commit 441a9fff6d
5 changed files with 77 additions and 1 deletions

View File

@ -255,6 +255,7 @@ public class FileLoadScanNode extends FileScanNode {
if (column.getDefaultValue() != null) {
if (column.getDefaultValueExprDef() != null) {
expr = column.getDefaultValueExpr();
expr.analyze(analyzer);
} else {
expr = new StringLiteral(destSlotDesc.getColumn().getDefaultValue());
}

View File

@ -51,3 +51,9 @@
-- !select_sql --
2
-- !select --
2
-- !select --
2

View File

@ -0,0 +1,2 @@
1,2010-11-30 23:59:59.281000
2,2011-11-30 23:59:59.281000
1 1 2010-11-30 23:59:59.281000
2 2 2011-11-30 23:59:59.281000

View File

@ -0,0 +1,2 @@
{"id":1,"name":"aa"}
{"id":2,"name":"bb"}

View File

@ -215,4 +215,69 @@ suite("test_current_timestamp") {
"""
exception "errCode = 2, detailMessage = Internal Error, maybe syntax error or this is a bug: column's default value current_timestamp precision must be between 0 and 6"
}
}
// user case
def tableName6 = "test_current_timestamp_4"
sql """ DROP TABLE IF EXISTS ${tableName6} """
sql """
CREATE TABLE IF NOT EXISTS ${tableName6}
(
`id` int,
`date_time` datetime(3),
`data_entry_time` datetime(3) NULL DEFAULT CURRENT_TIMESTAMP(3)
) DUPLICATE KEY(`id`)
DISTRIBUTED BY HASH(id)
PROPERTIES
(
"replication_num" = "1"
);
"""
streamLoad {
table "${tableName6}"
set 'columns', 'id,date_time'
set 'format', 'csv'
set 'column_separator', ','
file "test_current_timestamp_dft.csv"
time 10000
}
sql "sync"
qt_select """ select count(*) from ${tableName6} """
def tableName7 = "test_current_timestamp_5"
sql """ DROP TABLE IF EXISTS ${tableName7} """
sql """
CREATE TABLE ${tableName7} (
id int,
`name` varchar(50) NULL,
input_time datetime default current_timestamp
) ENGINE=OLAP
DUPLICATE KEY(`id`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 10
PROPERTIES (
"in_memory" = "false",
"storage_format" = "V2",
"replication_num" = "1"
);
"""
streamLoad {
table "${tableName7}"
set 'columns', 'id,name'
set 'format', 'json'
set 'read_json_by_line', 'true'
set 'strip_outer_array', 'false'
file "test_current_timestamp_dft.json"
time 10000
}
sql "sync"
qt_select """ select count(*) from ${tableName7} """
}