1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-27 08:21:15 +03:00
Files
mariadb-columnstore-engine/mtr/basic/t/mcs55_cpimport_binary_source.test
mariadb-RomanNavrotskiy 73b4147cf3 move mtr suites here
2021-01-31 01:38:31 +02:00

57 lines
1.2 KiB
Plaintext

#
# Binary source import
# Author: Susil, susil.behera@mariadb.com
#
-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcs55_db;
--enable_warnings
CREATE DATABASE mcs55_db;
USE mcs55_db;
CREATE TABLE t1(col1 INT, col2 INT) ENGINE=Columnstore;
# Prepare data
exec rm -f /tmp/mcs55.bin;
# NULL is accepting by cpimport. Will add after better gaining better understanding.
exec cat << EOF > /tmp/mcs55.bin
111|222
111|222
222|333
333|444
444|555
111|222
111|222
222|333
333|444
444|555
EOF;
# Binary mode with NULLs accepted Numeric fields containing NULL will be treated
# as NULL unless the column has a default value
--disable_result_log #cpimport logs thread/timestamps
--exec cpimport -I1 mcs55_db t1 '/tmp/mcs55.bin';
--enable_result_log
#Validate data
SELECT * FROM t1 ORDER BY col1;
SELECT COUNT(*) FROM t1;
TRUNCATE t1;
# Binary mode with NULLs saturated NULLs in numeric fields will be saturated
--disable_result_log #cpimport logs thread/timestamps
--exec cpimport -I2 mcs55_db t1 '/tmp/mcs55.bin';
--enable_result_log
#Validate data
SELECT * FROM t1 ORDER BY col1;
SELECT COUNT(*) FROM t1;
# Clean UP
--exec rm -f /tmp/mcs55.bin
DROP DATABASE mcs55_db;