File: maximum_line_size.test_slow

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (42 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (4)
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