mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
done
This commit is contained in:
parent
e6751f521d
commit
9fc7b52732
@ -0,0 +1 @@
|
||||
1 7
|
@ -0,0 +1,7 @@
|
||||
insert into table function file("data1622.json", "TSV", "value String") VALUES ('{"a":1}');
|
||||
drop table if exists json;
|
||||
create table json(a int, b int default 7) engine File(JSONEachRow, 'data1622.json');
|
||||
set input_format_defaults_for_omitted_fields = 1;
|
||||
select * from json;
|
||||
truncate table json;
|
||||
drop table if exists json;
|
@ -0,0 +1 @@
|
||||
Ok
|
36
tests/queries/0_stateless/01622_defaults_for_url_engine.sh
Executable file
36
tests/queries/0_stateless/01622_defaults_for_url_engine.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
|
||||
PORT="$(($RANDOM%63000+2001))"
|
||||
|
||||
TEMP_FILE="$CURDIR/01622_defaults_for_url_engine.tmp"
|
||||
|
||||
function thread1
|
||||
{
|
||||
while true; do
|
||||
echo -e "HTTP/1.1 200 OK\n\n{\"a\": 1}" | nc -l -p $1 -q 1;
|
||||
done
|
||||
}
|
||||
|
||||
function thread2
|
||||
{
|
||||
for iter in {1..100}; do
|
||||
$CLICKHOUSE_CLIENT -q "SELECT * FROM url('http://127.0.0.1:$1/', JSONEachRow, 'a int, b int default 7') format Values"
|
||||
done
|
||||
}
|
||||
|
||||
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
|
||||
export -f thread1;
|
||||
export -f thread2;
|
||||
|
||||
TIMEOUT=5
|
||||
|
||||
timeout $TIMEOUT bash -c "thread1 $PORT" > /dev/null 2>&1 &
|
||||
timeout $TIMEOUT bash -c "thread2 $PORT" 2> /dev/null > $TEMP_FILE &
|
||||
|
||||
wait
|
||||
|
||||
grep -q '(1,7)' $TEMP_FILE && echo "Ok"
|
Loading…
Reference in New Issue
Block a user