Skip to content

Commit

Permalink
add array nested map/struct cases
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Dec 17, 2024
1 parent 5b00b7e commit 0bbe638
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions regression-test/data/nereids_function_p0/array/test_array_map.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// this is data case file for array<map<largeInt:string,datetime:decimal<76,56>, char:double, ipv4:ipv6>> type, contains normal, corner, exceptional data cases
[]
[null]
NULL
// single element
[{}]
// all min/max with kv type
[{-170141183460469231731687303715884105728:"", '0000-01-01 00:00:00': 1.123456789012345678901234567890123456, '': 0.0, '0.0.0.0': "::"}]
[{"170141183460469231731687303715884105727":'测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测', '9999-12-31 23:59:59.999999': 1234567890123456789.543210987654321098765432109876543210, '9': 1.7976931348623157E308, '255.255.255.255': "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"}]
// random cases
[{"-1":'a', '0000-01-01 00:00:00': 0.0, '1': 1.0, '127.0.0.1': "::1"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// this is data case file for array<struct<f1:int,f2:date,f3:decimal,f4:string,f5:double,f6:ipv4,f7:ipv6>> type, contains normal, corner, exceptional data cases
// literal : [{1, 'doris1'}, {2, 'nereids1'}, {3, 'doris-nereids-1'}]
[]
[null]
NULL
// single element
[{}]
// smallint min/max value with ipvalue
[{32767, '2020-01-01', 32767.0, '32767', 32767.0, '0.0.0.1', '2001:0db8:0:0:0:0:0:1'}, {-32768, '2020-01-01', -32768.0, '-32768', -32768.0, '224.0.0.13', '2001:0db8:0:0:0:0:0:2'}]
// smallint min/max value + 1
[{32768, '2020-01-01', 32768.0, '32768', 32768.0, '127.0.0.1', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'}, {-32769, '2020-01-01', -32769.0, '-32769', -32769.0, '255.255.255.255', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:fffe'}]
// smallint min/max value - 1
[{32766, '2020-01-01', 32766.0, '32766', 32766.0, '1.1.1.1', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:fffd'}, {-32767, '2020-01-01', -32767.0, '-32767', -32767.0, '0.0.0.0', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:fffc'}]
// smallint -1-16
[{0, '2020-01-01', 0.0, '0', 0.0, '10.0.0.0', '2001:0db8:0:0:0:0:0:3'}, {1, '2020-01-01', 1.0, '1', 1.0, '10.0.0.1', '2001:0db8:0:0:0:0:0:4'}, {2, '2020-01-01', 2.0, '2', 2.0, '10.0.0.2', '2001:0db8:0:0:0:0:0:5'}, {3, '2020-01-01', 3.0, '3', 3.0, '10.0.0.3', '2001:0db8:0:0:0:0:0:6'}, {4, '2020-01-01', 4.0, '4', 4.0, '10.0.0.4', '2001:0db8:0:0:0:0:0:7'}, {5, '2020-01-01', 5.0, '5', 5.0, '10.0.0.5', '2001:0db8:0:0:0:0:0:8'}, {6, '2020-01-01', 6.0, '6', 6.0, '10.0.0.6', '2001:0db8:0:0:0:0:0:9'}, {7, '2020-01-01', 7.0, '7', 7.0, '10.0.0.7', '2001:0db8:0:0:0:0:0:10'}, {8, '2020-01-01', 8.0, '8', 8.0, '10.0.0.8', '2001:0db8:0:0:0:0:0:11'}, {9, '2020-01-01', 9.0, '9', 9.0, '10.0.0.9', '2001:0db8:0:0:0:0:0:12'}, {10, '2020-01-01', 10.0, '10', 10.0, '10.0.0.10', '2001:0db8:0:0:0:0:0:13'}, {11, '2020-01-01', 11.0, '11', 11.0, '10.0.0.11', '2001:0db8:0:0:0:0:0:14'}, {12, '2020-01-01', 12.0, '12', 12.0, '10.0.0.12', '2001:0db8:0:0:0:0:0:15'}, {13, '2020-01-01', 13.0, '13', 13.0, '10.0.0.13', '2001:0db8:0:0:0:0:0:16'}, {14, '2020-01-01', 14.0, '14', 14.0, '10.0.0.14', '2001:0db8:0:0:0:0:0:17'}, {15, '2020-01-01', 15.0, '15', 15.0, '10.0.0.15', '2001:0db8:0:0:0:0:0:18'}, {16, '2020-01-01', 16.0, '16', 16.0, '10.0.0.16', '2001:0db8:0:0:0:0:0:19'}]
// smallint 0-16 with null
[{0, '2020-01-01', 0.0, '0', 0.0, '10.0.0.0', '2001:0db8:0:0:0:0:0:3'}, {1, '2020-01-01', 1.0, '1', 1.0, '10.0.0.1', '2001:0db8:0:0:0:0:0:4'}, {2, '2020-01-01', 2.0, '2', 2.0, '10.0.0.2', '2001:0db8:0:0:0:0:0:5'}, {3, '2020-01-01', 3.0, '3', 3.0, '10.0.0.3', '2001:0db8:0:0:0:0:0:6'}, {4, '2020-01-01', 4.0, '4', 4.0, '10.0.0.4', '2001:0db8:0:0:0:0:0:7'}, {5, '2020-01-01', 5.0, '5', 5.0, '10.0.0.5', '2001:0db8:0:0:0:0:0:8'}, {6, '2020-01-01', 6.0, '6', 6.0, '10.0.0.6', '2001:0db8:0:0:0:0:0:9'}, {7, '2020-01-01', 7.0, '7', 7.0, '10.0.0.7', '2001:0db8:0:0:0:0:0:10'}, {8, '2020-01-01', 8.0, '8', 8.0, '10.0.0.8', '2001:0db8:0:0:0:0:0:11'}, {9, '2020-01-01', 9.0, '9', 9.0, '10.0.0.9', '2001:0db8:0:0:0:0:0:12'}, {10, '2020-01-01', 10.0, '10', 10.0, '10.0.0.10', '2001:0db8:0:0:0:0:0:13'}, {11, '2020-01-01', 11.0, '11', 11.0, '10.0.0.11', '2001:0db8:0:0:0:0:0:14'}, {12, '2020-01-01', 12.0, '12', 12.0, '10.0.0.12', '2001:0db8:0:0:0:0:0:15'}, {13, '2020-01-01', 13.0, '13', 13.0, '10.0.0.13', '2001:0db8:0:0:0:0:0:16'}, {14, '2020-01-01', 14.0, '14', 14.0, '10.0.0.14', '2001:0db8:0:0:0:0:0:17'}, {15, '2020-01-01', 15.0, '15', 15.0, '10.0.0.15', '2001:0db8:0:0:0:0:0:18'}, {16, '2020-01-01', 16.0, '16', 16.0, '10.0.0.16', '2001:0db8:0:0:0:0:0:19'}, null]
// sqrt(max) + 1, sqrt(max), sqrt(max) - 1
[{181, '2020-01-01', 181.0, '181', 181.0, '172.31.255.255', '2001:0db8:0:0:0:0:0:20'}, {181, '2020-01-01', 181.0, '181', 181.0, '172.31.255.254', '2001:0db8:0:0:0:0:0:21'}, {180, '2020-01-01', 180.0, '180', 180.0, '172.31.255.253', '2001:0db8:0:0:0:0:0:22'}, {179, '2020-01-01', 179.0, '179', 179.0, '172.31.255.252', '2001:0db8:0:0:0:0:0:23'}]
// sqrt(min) - 1, sqrt(min), sqrt(min) + 1
[{0, '2020-01-01', 0.0, '0', 0.0, '192.168.0.0', '2001:0db8:0:0:0:0:0:24'}, {0, '2020-01-01', 0.0, '0', 0.0, '192.168.0.1', '2001:0db8:0:0:0:0:0:25'}, {1, '2020-01-01', 1.0, '1', 1.0, '192.168.0.2', '2001:0db8:0:0:0:0:0:26'}]
// int min/max value
[{2147483647, '2020-01-01', 2147483647.0, '2147483647', 2147483647.0, '192.0.2.0', '2001:0db8:0:0:0:0:0:27'}, {-2147483648, '2020-01-01', -2147483648.0, '-2147483648', -2147483648.0, '192.0.2.1', '2001:0db8:0:0:0:0:0:28'}]
// int min/max value + 1
[{2147483648, '2020-01-01', 2147483648.0, '2147483648', 2147483648.0, '0.0.0.0', '2001:0db8:0:0:0:0:0:29'}, {-2147483649, '2020-01-01', -2147483649.0, '-2147483649', -2147483649.0, '1.1.1.1', '2001:0db8:0:0:0:0:0:30'}]
// int min/max value - 1
[{2147483648, '2020-01-01', 2147483648.0, '2147483648', 2147483648.0, '2.2.2.2', '2001:0db8:0:0:0:0:0:31'}, {-2147483649, '2020-01-01', -2147483649.0, '-2147483649', -2147483649.0, '3.3.3.3', '2001:0db8:0:0:0:0:0:32'}]
// sqrt(max) + 1, sqrt(max), sqrt(max) - 1
[{46340, '2020-01-01', 46340.0, '46340', 46340.0, '4.4.4.4', '2001:0db8:0:0:0:0:0:33'}, {46339, '2020-01-01', 46339.0, '46339', 46339.0, '5.5.5.5', '2001:0db8:0:0:0:0:0:34'}]

0 comments on commit 0bbe638

Please sign in to comment.