1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Feature/mcol 4882 cpimport skip rows (#3594)

* feat(cpimport): MCOL-4882 add a parameter to skip header rows

* chore(cpimport): MCOL-4882 Use boost::program_options to arguments parsing

* feat(cpimport.bin): MCOL-4882 Add missing changes

* add test

* fix clang

* add missing cmdline argument

* fix bug

* Fix double lines skipping

* Fix incorrect --silent (-N) parsing

* fix default --max-errors processing

* fix overwriting default username

* move initialization to members declaration
This commit is contained in:
Alexey Antipovsky
2025-07-11 21:35:43 +02:00
committed by GitHub
parent 1c8d5ec04e
commit 78c1b5034d
30 changed files with 1379 additions and 1469 deletions

View File

@ -0,0 +1,22 @@
DROP DATABASE IF EXISTS mcol4882;
CREATE DATABASE mcol4882;
USE mcol4882;
CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore;
SELECT * FROM t1;
col1 col2
1 test1
2 test2
3 test3
TRUNCATE t1;
SELECT * FROM t1;
col1 col2
2 test2
3 test3
TRUNCATE t1;
SELECT * FROM t1;
col1 col2
3 test3
TRUNCATE t1;
SELECT * FROM t1;
col1 col2
DROP DATABASE mcol4882;

View File

@ -0,0 +1,43 @@
if (!$MYSQL_TEST_ROOT){
skip Should be run by root to execute cpimport;
}
-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcol4882;
--enable_warnings
CREATE DATABASE mcol4882;
USE mcol4882;
CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore;
--exec printf '1,test1\n2,test2\n3,test3\n' > /tmp/mcol4882.csv
--disable_result_log
--exec $MCS_CPIMPORT -s , mcol4882 t1 /tmp/mcol4882.csv
--enable_result_log
SELECT * FROM t1;
TRUNCATE t1;
--disable_result_log
--exec $MCS_CPIMPORT -s , --headers -- mcol4882 t1 /tmp/mcol4882.csv
--enable_result_log
SELECT * FROM t1;
TRUNCATE t1;
--disable_result_log
--exec $MCS_CPIMPORT -s , --headers 2 mcol4882 t1 /tmp/mcol4882.csv
--enable_result_log
SELECT * FROM t1;
TRUNCATE t1;
--disable_result_log
--exec $MCS_CPIMPORT -s , --headers 5 mcol4882 t1 /tmp/mcol4882.csv
--enable_result_log
SELECT * FROM t1;
# Clean UP
--exec rm -f /tmp/mcol4882.csv
DROP DATABASE mcol4882;