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 32 33 34 35 36 37 38 39 40 41 42
|
# name: test/sql/copy/csv/maximum_line_size.test_slow
# description: Test maximum_line_size CSV option
# group: [csv]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE test (a INTEGER, b VARCHAR, c INTEGER);
# Linesize exceeds maximum_line_size
statement error
insert into test select * from read_csv('{DATA_DIR}/csv/test/test_long_line.csv', columns={'a': 'INTEGER', 'b': 'VARCHAR', 'c': 'INTEGER'}, maximum_line_size=0);
----
Possible Solution: Change the maximum length size, e.g., max_line_size=10009
# Single line too long
# "a".repeat(2 * 1024 * 1024 + 10);
statement error
select * from read_csv_auto('{DATA_DIR}/csv/issue_8320_1.csv.gz');
----
Maximum line size of 2000000 bytes exceeded
# Single line too long, but with actual newline at the end
# "a".repeat(2 * 1024 * 1024 + 10) + "\n";
statement error
select * from read_csv_auto('{DATA_DIR}/csv/issue_8320_2.csv.gz');
----
Possible Solution: Change the maximum length size, e.g., max_line_size=2097165
# Multiple lines too long
# String value = "a".repeat(2 * 1024 * 1024 + 10) + "\n"; String data = value + value + value + value;
statement error
select * from read_csv_auto('{DATA_DIR}/csv/issue_8320_3.csv.gz');
----
Possible Solution: Change the maximum length size, e.g., max_line_size=2097165
# Add a test to verify we throw if max line size below a buffer size
statement error
select * from read_csv_auto('{DATA_DIR}/csv/issue_8320_3.csv.gz', max_line_size = 2097152, buffer_size = 10);
----
Buffer Size of 10 must be a higher value than the maximum line size 2097152
|