add testcase. due to the error msg have version string so just print matched part

This commit is contained in:
tao jiang 2020-08-21 11:32:12 +08:00
parent 294aa985e0
commit a269855e2f
2 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ ERROR: DateTime must be in YYYY-MM-DD hh:mm:ss or NNNNNNNNNN (unix timestamp, ex
ERROR: Tab found where line feed is expected. It's like your file has more columns than expected. ERROR: Tab found where line feed is expected. It's like your file has more columns than expected.
ERROR: garbage after Decimal(18, 10): "Hello<LINE FEED>" ERROR: garbage after Decimal(18, 10): "Hello<LINE FEED>"
Column 0, name: t, type: DateTime, ERROR: text "<LINE FEED>" is not like DateTime Column 0, name: t, type: DateTime, ERROR: text "<LINE FEED>" is not like DateTime
Unexpected NULL value
CustomSeparated CustomSeparated
Column 2, name: d, type: Decimal(18, 10), parsed text: "123456789"ERROR Column 2, name: d, type: Decimal(18, 10), parsed text: "123456789"ERROR

View File

@ -28,6 +28,7 @@ echo -e '2020-04-21 12:34:567\tHello\t123456789' | "${PARSER[@]}" 2>&1| grep "ER
echo -e '2020-04-21 12:34:56\tHello\t12345678\t1' | "${PARSER[@]}" 2>&1| grep "ERROR" echo -e '2020-04-21 12:34:56\tHello\t12345678\t1' | "${PARSER[@]}" 2>&1| grep "ERROR"
echo -e '2020-04-21 12:34:56\t\t123Hello' | "${PARSER[@]}" 2>&1| grep "ERROR" echo -e '2020-04-21 12:34:56\t\t123Hello' | "${PARSER[@]}" 2>&1| grep "ERROR"
echo -e '2020-04-21 12:34:56\tHello\t12345678\n' | "${PARSER[@]}" 2>&1| grep "ERROR" echo -e '2020-04-21 12:34:56\tHello\t12345678\n' | "${PARSER[@]}" 2>&1| grep "ERROR"
echo -e '\N\tHello\t12345678' | "${PARSER[@]}" 2>&1| grep -o "Unexpected NULL value"
PARSER=(${CLICKHOUSE_LOCAL} --query 'SELECT t, s, d FROM table' --structure 't DateTime, s String, d Decimal64(10)' --input-format CustomSeparated) PARSER=(${CLICKHOUSE_LOCAL} --query 'SELECT t, s, d FROM table' --structure 't DateTime, s String, d Decimal64(10)' --input-format CustomSeparated)
echo -e '2020-04-21 12:34:56\tHello\t12345678' | "${PARSER[@]}" 2>&1| grep "ERROR" || echo -e "\nCustomSeparated" echo -e '2020-04-21 12:34:56\tHello\t12345678' | "${PARSER[@]}" 2>&1| grep "ERROR" || echo -e "\nCustomSeparated"