Skip to content

Commit 90df6bc

Browse files
authored
Merge pull request ClickHouse#73179 from Avogar/propogate-settings-to-native-tcp-handler
Propagate format settings to NativeWriter in TCPHandler
2 parents f0ae6bf + 8ecf7b1 commit 90df6bc

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

src/Server/TCPHandler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <Core/Settings.h>
1616
#include <Formats/NativeReader.h>
1717
#include <Formats/NativeWriter.h>
18+
#include <Formats/FormatFactory.h>
1819
#include <IO/LimitReadBuffer.h>
1920
#include <IO/Progress.h>
2021
#include <IO/ReadBufferFromPocoSocket.h>
@@ -2350,7 +2351,7 @@ void TCPHandler::initBlockOutput(QueryState & state, const Block & block)
23502351
*state.maybe_compressed_out,
23512352
client_tcp_protocol_version,
23522353
block.cloneEmpty(),
2353-
std::nullopt,
2354+
getFormatSettings(state.query_context),
23542355
!query_settings[Setting::low_cardinality_allow_in_native_format]);
23552356
}
23562357
}

tests/queries/0_stateless/01825_new_type_json_12.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $CLICKHOUSE_CLIENT -q "SELECT DISTINCT arrayJoin(JSONAllPathsWithTypes(obj)) as
4747
$CLICKHOUSE_CLIENT -q "SELECT DISTINCT arrayJoin(JSONAllPathsWithTypes(arrayJoin(obj.key_0[]))) as path FROM t_json_12 order by path;"
4848
$CLICKHOUSE_CLIENT -q "SELECT DISTINCT arrayJoin(JSONAllPathsWithTypes(arrayJoin(arrayJoin(obj.key_0[].key_1[])))) as path FROM t_json_12 order by path;"
4949
$CLICKHOUSE_CLIENT -q "SELECT DISTINCT arrayJoin(JSONAllPathsWithTypes(arrayJoin(arrayJoin(arrayJoin(obj.key_0[].key_1[].key_3[]))))) as path FROM t_json_12 order by path;"
50-
$CLICKHOUSE_CLIENT -q "SELECT obj FROM t_json_12 ORDER BY obj.id FORMAT JSONEachRow" --output_format_json_named_tuples_as_objects 1 --allow_suspicious_types_in_order_by 1
50+
$CLICKHOUSE_CLIENT -q "SELECT obj FROM t_json_12 ORDER BY obj.id FORMAT JSONEachRow" --output_format_json_named_tuples_as_objects 1 --allow_suspicious_types_in_order_by 1 --output_format_native_write_json_as_string=0
5151
$CLICKHOUSE_CLIENT -q "SELECT obj.key_0[].key_1[].key_3[].key_4, obj.key_0[].key_1[].key_3[].key_5, \
5252
obj.key_0[].key_1[].key_3[].key_6, obj.key_0[].key_1[].key_3[].key_7 FROM t_json_12 ORDER BY obj.id" --allow_suspicious_types_in_order_by 1
5353

tests/queries/0_stateless/01825_new_type_json_in_array.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SET allow_experimental_json_type = 1;
44
SET allow_experimental_analyzer = 1;
55
SET allow_suspicious_types_in_order_by = 1;
66
SET allow_suspicious_types_in_group_by = 1;
7+
SET output_format_native_write_json_as_string = 0;
78

89
DROP TABLE IF EXISTS t_json_array;
910

tests/queries/0_stateless/03282_json_equal_comparison.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set enable_json_type=1;
2+
set output_format_native_write_json_as_string=0;
23
create table test (json1 JSON(max_dynamic_paths=2, a UInt32), json2 JSON(max_dynamic_paths=2, a UInt32)) engine=Memory;
34
insert into test format JSONEachRow
45
{"json1" : {}, "json2" : {}}

0 commit comments

Comments
 (0)