1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
# name: test/sql/copy/csv/test_cast_error.test_slow
# description: Test casting error in last lines of a big csv file
# group: [csv]
statement ok
PRAGMA enable_verification
statement ok
copy (select 'name' as name, 1 as i from range(10000000) union all select 'name', 'hello world' union all select 'name', 'xxxxx' union all select 'name', 1 from range(10000)) to '__TEST_DIR__/bigcsv.csv';
query I
select count(*) from '__TEST_DIR__/bigcsv.csv';
----
10010002
statement error
select count(i), count(*) from '__TEST_DIR__/bigcsv.csv';
----
Error when converting column "i".
statement error
select name, i, count(*) from read_csv('__TEST_DIR__/bigcsv.csv') group by all;
----
Error when converting column "i".
query III
select name, i, count(*) from read_csv('__TEST_DIR__/bigcsv.csv', types={'i': 'VARCHAR'}) group by all order by all;
----
name 1 10010000
name hello world 1
name xxxxx 1
|