eldenmoon commented on code in PR #45435: URL: https://github.com/apache/doris/pull/45435#discussion_r1889927219
########## regression-test/suites/nereids_function_p0/load.groovy: ########## @@ -556,6 +558,267 @@ suite("load") { file "fn_test.dat" } + // set enable_decimal256 = true + sql """ set enable_decimal256 = true """ + // create table for array not-null|nullable and rowstore + sql """ DROP TABLE IF EXISTS fn_test_not_nullable_array""" + sql """ + CREATE TABLE IF NOT EXISTS `fn_test_not_nullable_array` ( + `id` int not null, + `kabool` array<boolean> not null default '[]', + `katint` array<tinyint(4)> not null default '[]', + `kasint` array<smallint(6)> not null default '[]', + `kaint` array<int> not null default '[]', + `kabint` array<bigint(20)> not null default '[]', + `kalint` array<largeint(40)> not null default '[]', + `kafloat` array<float> not null default '[]', + `kadbl` array<double> not null default '[]', + `kadt` array<date> not null default '[]', + `kadtm` array<datetime> not null default '[]', + `kadtv2` array<datev2> not null default '[]', + `kadtmv2_` array<datetimev2(0)> not null default '[]', + `kadtmv2` array<datetimev2(6)> not null default '[]', + `kachr` array<char(255)> not null default '[]', + `kavchr` array<varchar(65533)> not null default '[]', + `kastr` array<string> not null default '[]', + `kadcmlv2` array<decimalv2(10, 0)> not null default '[]', + `kadcml` array<decimal(27, 9)> not null default '[]', + `kadcml1` array<decimal(16, 10)> not null default '[]', + `kadcml2` array<decimal(38, 38)> not null default '[]', + `kadcml256` array<decimal(76,56)> not null default '[]', + `kaipv4` array<ipv4> not null default '[]', + `kaipv6` array<ipv6> not null default '[]' + ) engine=olap + DISTRIBUTED BY HASH(`id`) BUCKETS 4 + properties("replication_num" = "1") + """ + + sql """ DROP TABLE IF EXISTS fn_test_nullable_array""" + sql """ + CREATE TABLE IF NOT EXISTS `fn_test_nullable_array` ( + `id` int null, + `kabool` array<boolean> null, + `katint` array<tinyint(4)> null, + `kasint` array<smallint(6)> null, + `kaint` array<int> null, + `kabint` array<bigint(20)> null, + `kalint` array<largeint(40)> null, + `kafloat` array<float> null, + `kadbl` array<double> null, + `kadt` array<date> null, + `kadtm` array<datetime> null, + `kadtv2` array<datev2> null, + `kadtmv2_` array<datetimev2(0)> null, + `kadtmv2` array<datetimev2(6)> null, + `kachr` array<char(255)> null, + `kavchr` array<varchar(65533)> null, + `kastr` array<string> null, + `kadcmlv2` array<decimalv2(10, 0)> null, + `kadcml` array<decimal(27, 9)> null, + `kadcml1` array<decimal(16, 10)> null, + `kadcml2` array<decimal(38, 38)> null, + `kadcml256` array<decimal(76,56)> null, + `kaipv4` array<ipv4> null, + `kaipv6` array<ipv6> null + ) engine=olap + DISTRIBUTED BY HASH(`id`) BUCKETS 4 + properties("replication_num" = "1") + """ + + sql """ DROP TABLE IF EXISTS fn_test_nullable_rowstore_array""" + sql """ + CREATE TABLE IF NOT EXISTS `fn_test_nullable_rowstore_array` ( + `id` int null, + `kabool` array<boolean> null, + `katint` array<tinyint(4)> null, + `kasint` array<smallint(6)> null, + `kaint` array<int> null, + `kabint` array<bigint(20)> null, + `kalint` array<largeint(40)> null, + `kafloat` array<float> null, + `kadbl` array<double> null, + `kadt` array<date> null, + `kadtm` array<datetime> null, + `kadtv2` array<datev2> null, + `kadtmv2_` array<datetimev2(0)> null, + `kadtmv2` array<datetimev2(6)> null, + `kachr` array<char(255)> null, + `kavchr` array<varchar(65533)> null, + `kastr` array<string> null, + `kadcmlv2` array<decimalv2(10, 0)> null, + `kadcml` array<decimal(27, 9)> null, + `kadcml1` array<decimal(16, 10)> null, + `kadcml2` array<decimal(38, 38)> null, + `kadcml256` array<decimal(76,56)> null, + `kaipv4` array<ipv4> null, + `kaipv6` array<ipv6> null + ) engine=olap + DISTRIBUTED BY HASH(`id`) BUCKETS 4 + properties("replication_num" = "1","store_row_column" = "true") + """ + + sql """ DROP TABLE IF EXISTS fn_test_not_nullable_rowstore_array""" + sql """ + CREATE TABLE IF NOT EXISTS `fn_test_not_nullable_rowstore_array` ( + `id` int not null, + `kabool` array<boolean> not null default '[]', + `katint` array<tinyint(4)> not null default '[]', + `kasint` array<smallint(6)> not null default '[]', + `kaint` array<int> not null default '[]', + `kabint` array<bigint(20)> not null default '[]', + `kalint` array<largeint(40)> not null default '[]', + `kafloat` array<float> not null default '[]', + `kadbl` array<double> not null default '[]', + `kadt` array<date> not null default '[]', + `kadtm` array<datetime> not null default '[]', + `kadtv2` array<datev2> not null default '[]', + `kadtmv2_` array<datetimev2(0)> not null default '[]', + `kadtmv2` array<datetimev2(6)> not null default '[]', + `kachr` array<char(255)> not null default '[]', + `kavchr` array<varchar(65533)> not null default '[]', + `kastr` array<string> not null default '[]', + `kadcmlv2` array<decimalv2(10, 0)> not null default '[]', + `kadcml` array<decimal(27, 9)> not null default '[]', + `kadcml1` array<decimal(16, 10)> not null default '[]', + `kadcml2` array<decimal(38, 38)> not null default '[]', + `kadcml256` array<decimal(76,56)> not null default '[]', + `kaipv4` array<ipv4> not null default '[]', + `kaipv6` array<ipv6> not null default '[]' + ) engine=olap + DISTRIBUTED BY HASH(`id`) BUCKETS 4 + properties("replication_num" = "1","store_row_column" = "true") + """ + + + +// // we read csv files to table + def read_custom_csv_data_for_array = { tableName, filePaths, columnNames, not_null -> + def res = sql "select count() from $tableName" + def row_cnt = res[0][0] + 1 + assert filePaths.size() == columnNames.size() + List<List<String>> table_content = new ArrayList<List<String>>() + def max_row = 0 + def dataDir = "${context.dataPath}/" + for (int i = 0; i < filePaths.size(); i++) { + def filePath = dataDir + filePaths[i] + log.info("read file: ${filePath}".toString()) + try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { + String line + List<String> col_content = new ArrayList<String>() + while ((line = br.readLine()) != null) { + log.info("line: ${line}".toString()) + if (line.startsWith("//")) { + continue + } + col_content.add(line) + } + max_row = Math.max(max_row, col_content.size()) + table_content.add(col_content) + } catch (IOException e) { + e.printStackTrace() + } + } + // construct insert sql + for (int i = 0; i < max_row; i++) { Review Comment: what about seperate to serveral batches of insert? and compaction will be tested -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org