2017-01-27 04:29:47 +00:00
#!/usr/bin/env bash
2017-12-15 19:34:19 +00:00
CURDIR = $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd )
. $CURDIR /../shell_config.sh
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
$CLICKHOUSE_CLIENT --query= "DROP TABLE IF EXISTS formats_test"
$CLICKHOUSE_CLIENT --query= "CREATE TABLE formats_test (x UInt64, s String) ENGINE = Memory"
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
echo -ne '1\tHello\n \n3\tGoodbye\n' | $CLICKHOUSE_CLIENT --input_format_allow_errors_num= 1 --input_format_allow_errors_ratio= 0.1 --query= "INSERT INTO formats_test FORMAT TSV"
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
$CLICKHOUSE_CLIENT --query= "SELECT * FROM formats_test ORDER BY x, s"
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
echo -ne '1\tHello\n2\n3\tGoodbye\n\n' | $CLICKHOUSE_CLIENT --input_format_allow_errors_num= 1 --input_format_allow_errors_ratio= 0.1 --query= "INSERT INTO formats_test FORMAT TSV" 2> /dev/null; echo $?
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
echo -ne '1\tHello\n2\n3\tGoodbye\n\n' | $CLICKHOUSE_CLIENT --input_format_allow_errors_num= 2 --input_format_allow_errors_ratio= 0.1 --query= "INSERT INTO formats_test FORMAT TSV"
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
$CLICKHOUSE_CLIENT --query= "SELECT * FROM formats_test ORDER BY x, s"
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
echo -ne '1\tHello\n2\n3\tGoodbye\n\n' | $CLICKHOUSE_CLIENT --input_format_allow_errors_num= 1 --input_format_allow_errors_ratio= 0.4 --query= "INSERT INTO formats_test FORMAT TSV" 2> /dev/null; echo $?
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
echo -ne '1\tHello\n2\n3\tGoodbye\n\n' | $CLICKHOUSE_CLIENT --input_format_allow_errors_num= 1 --input_format_allow_errors_ratio= 0.6 --query= "INSERT INTO formats_test FORMAT TSV"
2017-05-22 12:42:39 +00:00
2019-04-16 14:13:13 +00:00
echo -ne 'x=1\ts=TSKV\nx=minus2\ts=trash1\ns=trash2\tx=-3\ns=TSKV Ok\tx=4\ns=trash3\tx=-5\n' | $CLICKHOUSE_CLIENT --input_format_allow_errors_num= 3 -q "INSERT INTO formats_test FORMAT TSKV"
2017-01-27 04:29:47 +00:00
2019-04-16 14:13:13 +00:00
$CLICKHOUSE_CLIENT --query= "SELECT * FROM formats_test ORDER BY x, s"
2017-12-15 19:34:19 +00:00
2019-04-16 14:13:13 +00:00
$CLICKHOUSE_CLIENT --query= "DROP TABLE formats_test"