-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Expand file tree
/
Copy pathFormatFactorySettings.h
More file actions
1680 lines (1463 loc) · 87.4 KB
/
Copy pathFormatFactorySettings.h
File metadata and controls
1680 lines (1463 loc) · 87.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
/// This header exists so we can share it between multiple setting objects that include format settings
#include <Core/SettingsObsoleteMacros.h>
#include <Core/SettingsFields.h>
#include <Core/Defines.h>
// clang-format off
#if defined(__CLION_IDE__)
/// CLion freezes for a minute every time it processes this
#define FORMAT_FACTORY_SETTINGS(M, ALIAS)
#define OBSOLETE_FORMAT_SETTINGS(M, ALIAS)
#else
#define FORMAT_FACTORY_SETTINGS(DECLARE, ALIAS) \
DECLARE(Char, format_csv_delimiter, ',', R"(
The character to be considered as a delimiter in CSV data. If setting with a string, a string has to have a length of 1.
)", 0) \
DECLARE(Bool, format_csv_allow_single_quotes, false, R"(
If it is set to true, allow strings in single quotes.
)", 0) \
DECLARE(Bool, format_csv_allow_double_quotes, true, R"(
If it is set to true, allow strings in double quotes.
)", 0) \
DECLARE(Bool, input_format_parallel_parsing, true, R"(
Enables or disables order-preserving parallel parsing of data formats. Supported only for [TabSeparated (TSV)](/interfaces/formats/TabSeparated), [TSKV](/interfaces/formats/TSKV), [CSV](/interfaces/formats/CSV) and [JSONEachRow](/interfaces/formats/JSONEachRow) formats.
Possible values:
- 1 — Enabled.
- 0 — Disabled.
)", 0) \
DECLARE(Bool, output_format_parallel_formatting, true, R"(
Enables or disables parallel formatting of data formats. Supported only for [TSV](/interfaces/formats/TabSeparated), [TSKV](/interfaces/formats/TSKV), [CSV](/interfaces/formats/CSV) and [JSONEachRow](/interfaces/formats/JSONEachRow) formats.
Possible values:
- 1 — Enabled.
- 0 — Disabled.
)", 0) \
DECLARE(Bool, output_format_csv_serialize_tuple_into_separate_columns, true, R"(
If it set to true, then Tuples in CSV format are serialized as separate columns (that is, their nesting in the tuple is lost)
)", 0) \
DECLARE(Bool, output_format_csv_header_serialize_tuple_into_separate_columns, true, R"(
When [output_format_csv_serialize_tuple_into_separate_columns](#output_format_csv_serialize_tuple_into_separate_columns) is enabled, the header rows of `CSVWithNames` and `CSVWithNamesAndTypes` flatten each Tuple column into its leaf fields (dotted names like `t.a`, `t.b`, and the leaf type names), so the header has the same number of columns as the data. For `CustomSeparated*` this flattening applies only when `format_custom_escaping_rule = 'CSV'` and `format_custom_field_delimiter` is a single character equal to `format_csv_delimiter`; otherwise (for example the default tab delimiter or `format_custom_field_delimiter = '|'`) the header stays unflattened so it still matches the data. Set it to `0` to keep the previous behavior where the header keeps the single top-level Tuple name and type.
Note: a flattened header is not read back into a Tuple by name when `input_format_with_names_use_header = 1`. To read such data back into a Tuple, either set this setting to `0` on output, or read with `input_format_with_names_use_header = 0` (and, for the `*WithNamesAndTypes` formats `CSVWithNamesAndTypes` and `CustomSeparatedWithNamesAndTypes`, also `input_format_with_types_use_header = 0`, since the flattened types row is otherwise validated against the single top-level Tuple input field and rejected).
)", 0) \
DECLARE(Bool, input_format_csv_deserialize_separate_columns_into_tuple, true, R"(
If it set to true, then separate columns written in CSV format can be deserialized to Tuple column.
)", 0) \
DECLARE(Bool, output_format_csv_crlf_end_of_line, false, R"(
If it is set true, end of line in CSV format will be \\r\\n instead of \\n.
)", 0) \
DECLARE(Bool, input_format_csv_allow_cr_end_of_line, false, R"(
If it is set true, \\r will be allowed at end of line not followed by \\n
)", 0) \
DECLARE(Bool, input_format_csv_enum_as_number, false, R"(
Treat inserted enum values in CSV formats as enum indices
)", 0) \
DECLARE(Bool, input_format_csv_arrays_as_nested_csv, false, R"(
When reading Array from CSV, expect that its elements were serialized in nested CSV and then put into string. Example: \"[\"\"Hello\"\", \"\"world\"\", \"\"42\"\"\"\" TV\"\"]\". Braces around array can be omitted.
)", 0) \
DECLARE(Bool, input_format_skip_unknown_fields, true, R"(
Enables or disables skipping insertion of extra data.
When writing data, ClickHouse throws an exception if input data contain columns that do not exist in the target table. If skipping is enabled, ClickHouse does not insert extra data and does not throw an exception.
Supported formats:
- [JSONEachRow](/interfaces/formats/JSONEachRow) (and other JSON formats)
- [BSONEachRow](/interfaces/formats/BSONEachRow) (and other JSON formats)
- [TSKV](/interfaces/formats/TSKV)
- All formats with suffixes WithNames/WithNamesAndTypes
- [MySQLDump](/interfaces/formats/MySQLDump)
- [Native](/interfaces/formats/Native)
Possible values:
- 0 — Disabled.
- 1 — Enabled.
)", 0) \
DECLARE(Bool, input_format_with_names_use_header, true, R"(
Enables or disables checking the column order when inserting data.
To improve insert performance, we recommend disabling this check if you are sure that the column order of the input data is the same as in the target table.
Supported formats:
- [CSVWithNames](/interfaces/formats/CSVWithNames)
- [CSVWithNamesAndTypes](/interfaces/formats/CSVWithNamesAndTypes)
- [TabSeparatedWithNames](/interfaces/formats/TabSeparatedWithNames)
- [TabSeparatedWithNamesAndTypes](/interfaces/formats/TabSeparatedWithNamesAndTypes)
- [JSONCompactEachRowWithNames](/interfaces/formats/JSONCompactEachRowWithNames)
- [JSONCompactEachRowWithNamesAndTypes](/interfaces/formats/JSONCompactEachRowWithNamesAndTypes)
- [JSONCompactStringsEachRowWithNames](/interfaces/formats/JSONCompactStringsEachRowWithNames)
- [JSONCompactStringsEachRowWithNamesAndTypes](/interfaces/formats/JSONCompactStringsEachRowWithNamesAndTypes)
- [RowBinaryWithNames](/interfaces/formats/RowBinaryWithNames)
- [RowBinaryWithNamesAndTypes](/interfaces/formats/RowBinaryWithNamesAndTypes)
- [CustomSeparatedWithNames](/interfaces/formats/CustomSeparatedWithNames)
- [CustomSeparatedWithNamesAndTypes](/interfaces/formats/CustomSeparatedWithNamesAndTypes)
Possible values:
- 0 — Disabled.
- 1 — Enabled.
)", 0) \
DECLARE(Bool, input_format_with_types_use_header, true, R"(
Controls whether format parser should check if data types from the input data match data types from the target table.
Supported formats:
- [CSVWithNamesAndTypes](/interfaces/formats/CSVWithNamesAndTypes)
- [TabSeparatedWithNamesAndTypes](/interfaces/formats/TabSeparatedWithNamesAndTypes)
- [JSONCompactEachRowWithNamesAndTypes](/interfaces/formats/JSONCompactEachRowWithNamesAndTypes)
- [JSONCompactStringsEachRowWithNamesAndTypes](/interfaces/formats/JSONCompactStringsEachRowWithNamesAndTypes)
- [RowBinaryWithNamesAndTypes](/interfaces/formats/RowBinaryWithNamesAndTypes)
- [CustomSeparatedWithNamesAndTypes](/interfaces/formats/CustomSeparatedWithNamesAndTypes)
Possible values:
- 0 — Disabled.
- 1 — Enabled.
)", 0) \
DECLARE(Bool, input_format_import_nested_json, false, R"(
Enables or disables the insertion of JSON data with nested objects.
Supported formats:
- [JSONEachRow](/interfaces/formats/JSONEachRow)
Possible values:
- 0 — Disabled.
- 1 — Enabled.
See also:
- [Usage of Nested Structures](/integrations/data-formats/json/other-formats#accessing-nested-json-objects) with the `JSONEachRow` format.
)", 0) \
DECLARE(Bool, input_format_defaults_for_omitted_fields, true, R"(
When performing `INSERT` queries, replace omitted input column values with default values of the respective columns. This option applies to [JSONEachRow](/interfaces/formats/JSONEachRow) (and other JSON formats), [CSV](/interfaces/formats/CSV), [TabSeparated](/interfaces/formats/TabSeparated), [TSKV](/interfaces/formats/TSKV), [Parquet](/interfaces/formats/Parquet), [Arrow](/interfaces/formats/Arrow), [Avro](/interfaces/formats/Avro), [ORC](/interfaces/formats/ORC), [Native](/interfaces/formats/Native) formats and formats with `WithNames`/`WithNamesAndTypes` suffixes.
:::note
When this option is enabled, extended table metadata are sent from server to client. It consumes additional computing resources on the server and can reduce performance.
:::
Possible values:
- 0 — Disabled.
- 1 — Enabled.
)", IMPORTANT) \
DECLARE(Bool, input_format_csv_empty_as_default, true, R"(
Treat empty fields in CSV input as default values.
)", 0) \
DECLARE(Bool, input_format_csv_missing_nullable_as_empty_string, false, R"(
Controls how `Nullable(String)` is read from a missing value in CSV. A missing value is an empty space between/before/after commas, not surrounded by quotes. If this setting is enabled, regardless of the value of `input_format_csv_empty_as_default`, the missing value of `Nullable(String)` will be interpreted as an empty `String`, not as NULL.
)", 0) \
DECLARE(Bool, input_format_tsv_empty_as_default, false, R"(
Treat empty fields in TSV input as default values.
)", 0) \
DECLARE(Bool, input_format_tsv_enum_as_number, false, R"(
Treat inserted enum values in TSV formats as enum indices.
)", 0) \
DECLARE(Bool, input_format_null_as_default, true, R"(
Enables or disables the initialization of [NULL](/sql-reference/syntax#literals) fields with [default values](/sql-reference/statements/create/table#default_values), if data type of these fields is not [nullable](/sql-reference/data-types/nullable).
If column type is not nullable and this setting is disabled, then inserting `NULL` causes an exception. If column type is nullable, then `NULL` values are inserted as is, regardless of this setting.
This setting is applicable for most input formats.
For complex default expressions `input_format_defaults_for_omitted_fields` must be enabled too.
Possible values:
- 0 — Inserting `NULL` into a not nullable column causes an exception.
- 1 — `NULL` fields are initialized with default column values.
)", 0) \
DECLARE(Bool, input_format_force_null_for_omitted_fields, false, R"(
Force initialize omitted fields with null values
)", 0) \
DECLARE(Bool, input_format_arrow_case_insensitive_column_matching, false, R"(
Ignore case when matching Arrow columns with CH columns.
)", 0) \
DECLARE(Int64, input_format_orc_row_batch_size, 100'000, R"(
Batch size when reading ORC stripes.
)", 0) \
DECLARE(Bool, input_format_orc_case_insensitive_column_matching, false, R"(
Ignore case when matching ORC columns with CH columns.
)", 0) \
DECLARE(Bool, input_format_parquet_case_insensitive_column_matching, false, R"(
Ignore case when matching Parquet columns with CH columns.
)", 0) \
DECLARE(Bool, input_format_parquet_preserve_order, false, R"(
Avoid reordering rows when reading from Parquet files. Not recommended as row ordering is generally not guaranteed, and other parts of query pipeline may break it. Use `ORDER BY _row_number` instead.
)", 0) \
DECLARE(Bool, input_format_parquet_filter_push_down, true, R"(
When reading Parquet files, skip whole row groups based on the WHERE/PREWHERE expressions and min/max statistics in the Parquet metadata.
)", 0) \
DECLARE(Bool, input_format_parquet_bloom_filter_push_down, true, R"(
When reading Parquet files, skip whole row groups based on the WHERE expressions and bloom filter in the Parquet metadata.
)", 0) \
DECLARE(Bool, input_format_parquet_enable_json_parsing, true, R"(
When reading Parquet files, parse JSON columns as ClickHouse JSON Column.
)", 0) \
DECLARE(UInt64, input_format_parquet_memory_low_watermark, 2ul << 20, R"(
Schedule prefetches more aggressively if memory usage is below than threshold. Potentially useful e.g. if there are many small bloom filters to read over network.
)", 0) \
DECLARE(UInt64, input_format_parquet_memory_high_watermark, 4ul << 30, R"(
Approximate memory limit for Parquet reader v3. Limits how many row groups or columns can be read in parallel. When reading multiple files in one query, the limit is on total memory usage across those files.
)", 0) \
DECLARE(Bool, input_format_parquet_page_filter_push_down, true, R"(
Skip pages using min/max values from column index.
)", 0) \
DECLARE(Bool, input_format_parquet_use_offset_index, true, R"(
Minor tweak to how pages are read from parquet file when no page filtering is used.
)", 0) \
DECLARE(Bool, input_format_parquet_verify_checksums, true, R"(
Verify page checksums when reading parquet files.
)", 0) \
DECLARE(Bool, input_format_parquet_local_time_as_utc, true, R"(
Determines the data type used by schema inference for Parquet timestamps with isAdjustedToUTC=false. If true: DateTime64(..., 'UTC'), if false: DateTime64(...). Neither behavior is fully correct as ClickHouse doesn't have a data type for local wall-clock time. Counterintuitively, 'true' is probably the less incorrect option, because formatting the 'UTC' timestamp as String will produce representation of the correct local time.
)", 0) \
DECLARE(Bool, input_format_allow_seeks, true, R"(
Allow seeks (or range reads) while reading ORC, Parquet, and Arrow input formats.
When enabled and the source supports it (e.g. local file, S3, HTTP with range support and known size),
ClickHouse can read only the needed byte ranges and use less memory.
When disabled, or when the source does not support seeks (e.g. no file size, or stream not seekable),
some readers may fall back to loading the full file into memory.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_orc_allow_missing_columns, true, R"(
Allow missing columns while reading ORC input formats
)", 0) \
DECLARE(Bool, input_format_orc_use_fast_decoder, true, R"(
Use a faster ORC decoder implementation.
)", 0) \
DECLARE(Bool, input_format_orc_filter_push_down, true, R"(
When reading ORC files, skip whole stripes or row groups based on the WHERE/PREWHERE expressions, min/max statistics or bloom filter in the ORC metadata.
)", 0) \
DECLARE(String, input_format_orc_reader_time_zone_name, "GMT", R"(
The time zone name for ORC row reader, the default ORC row reader's time zone is GMT.
)", 0) \
DECLARE(Bool, input_format_orc_dictionary_as_low_cardinality, true, R"(
Treat ORC dictionary encoded columns as LowCardinality columns while reading ORC files.
)", 0) \
DECLARE(Bool, input_format_parquet_allow_missing_columns, true, R"(
Allow missing columns while reading Parquet input formats
)", 0) \
DECLARE(UInt64, input_format_parquet_local_file_min_bytes_for_seek, 8192, R"(
Min bytes required for local read (file) to do seek, instead of read with ignore in Parquet input format
)", 0) \
DECLARE(Bool, input_format_parquet_enable_row_group_prefetch, true, R"(
Enable row group prefetching during parquet parsing. Currently, only single-threaded parsing can prefetch.
)", 0) \
DECLARE(Bool, input_format_arrow_allow_missing_columns, true, R"(
Allow missing columns while reading Arrow input formats
)", 0) \
DECLARE(Char, input_format_hive_text_fields_delimiter, '\x01', R"(
Delimiter between fields in Hive Text File
)", 0) \
DECLARE(Char, input_format_hive_text_collection_items_delimiter, '\x02', R"(
Delimiter between collection(array or map) items in Hive Text File
)", 0) \
DECLARE(Char, input_format_hive_text_map_keys_delimiter, '\x03', R"(
Delimiter between a pair of map key/values in Hive Text File
)", 0) \
DECLARE(Bool, input_format_hive_text_allow_variable_number_of_columns, true, R"(
Ignore extra columns in Hive Text input (if file has more columns than expected) and treat missing fields in Hive Text input as default values
)", 0) \
DECLARE(UInt64, input_format_msgpack_number_of_columns, 0, R"(
The number of columns in inserted MsgPack data. Used for automatic schema inference from data.
)", 0) \
DECLARE(MsgPackUUIDRepresentation, output_format_msgpack_uuid_representation, FormatSettings::MsgPackUUIDRepresentation::EXT, R"(
The way how to output UUID in MsgPack format.
)", 0) \
DECLARE(UInt64, input_format_max_rows_to_read_for_schema_inference, 25000, R"(
The maximum rows of data to read for automatic schema inference.
)", 0) \
DECLARE(UInt64, input_format_max_bytes_to_read_for_schema_inference, 32 * 1024 * 1024, R"(
The maximum amount of data in bytes to read for automatic schema inference.
)", 0) \
DECLARE(Bool, input_format_csv_use_best_effort_in_schema_inference, true, R"(
Use some tweaks and heuristics to infer schema in CSV format
)", 0) \
DECLARE(Bool, input_format_csv_try_infer_numbers_from_strings, false, R"(
If enabled, during schema inference ClickHouse will try to infer numbers from string fields.
It can be useful if CSV data contains quoted UInt64 numbers.
Disabled by default.
)", 0) \
DECLARE(Bool, input_format_csv_try_infer_strings_from_quoted_tuples, true, R"(
Interpret quoted tuples in the input data as a value of type String.
)", 0) \
DECLARE(Bool, input_format_tsv_use_best_effort_in_schema_inference, true, R"(
Use some tweaks and heuristics to infer schema in TSV format
)", 0) \
DECLARE(Bool, input_format_csv_detect_header, true, R"(
Automatically detect header with names and types in CSV format
)", 0) \
DECLARE(Bool, input_format_csv_allow_whitespace_or_tab_as_delimiter, false, R"(
Allow to use spaces and tabs(\\t) as field delimiter in the CSV strings
)", 0) \
DECLARE(Bool, input_format_csv_trim_whitespaces, true, R"(
Trims spaces and tabs (\\t) characters at the beginning and end in CSV strings
)", 0) \
DECLARE(Bool, input_format_csv_use_default_on_bad_values, false, R"(
Allow to set default value to column when CSV field deserialization failed on bad value
)", 0) \
DECLARE(Bool, input_format_csv_allow_variable_number_of_columns, false, R"(
Ignore extra columns in CSV input (if file has more columns than expected) and treat missing fields in CSV input as default values
)", 0) \
DECLARE(Bool, input_format_tsv_allow_variable_number_of_columns, false, R"(
Ignore extra columns in TSV input (if file has more columns than expected) and treat missing fields in TSV input as default values
)", 0) \
DECLARE(Bool, input_format_custom_allow_variable_number_of_columns, false, R"(
Ignore extra columns in CustomSeparated input (if file has more columns than expected) and treat missing fields in CustomSeparated input as default values
)", 0) \
DECLARE(Bool, input_format_json_compact_allow_variable_number_of_columns, false, R"(
Allow variable number of columns in rows in JSONCompact/JSONCompactEachRow input formats.
Ignore extra columns in rows with more columns than expected and treat missing columns as default values.
Disabled by default.
)", 0) \
DECLARE(Bool, input_format_tsv_detect_header, true, R"(
Automatically detect header with names and types in TSV format
)", 0) \
DECLARE(Bool, input_format_custom_detect_header, true, R"(
Automatically detect header with names and types in CustomSeparated format
)", 0) \
DECLARE(Bool, input_format_parquet_skip_columns_with_unsupported_types_in_schema_inference, false, R"(
Skip columns with unsupported types while schema inference for format Parquet
)", 0) \
DECLARE(NonZeroUInt64, input_format_parquet_max_block_size, DEFAULT_BLOCK_SIZE, R"(
Max block size for parquet reader.
)", 0) \
DECLARE(UInt64, input_format_parquet_prefer_block_bytes, DEFAULT_BLOCK_SIZE * 256, R"(
Average block bytes output by parquet reader
)", 0) \
DECLARE(Bool, input_format_protobuf_skip_fields_with_unsupported_types_in_schema_inference, false, R"(
Skip fields with unsupported types while schema inference for format Protobuf
)", 0) \
DECLARE(Bool, input_format_capn_proto_skip_fields_with_unsupported_types_in_schema_inference, false, R"(
Skip columns with unsupported types while schema inference for format CapnProto
)", 0) \
DECLARE(Bool, input_format_orc_skip_columns_with_unsupported_types_in_schema_inference, false, R"(
Skip columns with unsupported types while schema inference for format ORC
)", 0) \
DECLARE(Bool, input_format_arrow_skip_columns_with_unsupported_types_in_schema_inference, false, R"(
Skip columns with unsupported types while schema inference for format Arrow
)", 0) \
DECLARE(Bool, input_format_arrow_use_native_reader, true, R"(
Use the native ClickHouse reader for the Arrow and ArrowStream formats instead of the one based on the Apache Arrow library.
)", 0) \
DECLARE(String, column_names_for_schema_inference, "", R"(
The list of column names to use in schema inference for formats without column names. The format: 'column1,column2,column3,...'
)", 0) \
DECLARE(String, schema_inference_hints, "", R"(
The list of column names and types to use as hints in schema inference for formats without schema.
Example:
Query:
```sql
desc format(JSONEachRow, '{"x" : 1, "y" : "String", "z" : "0.0.0.0" }') settings schema_inference_hints='x UInt8, z IPv4';
```
Result:
```sql
x UInt8
y Nullable(String)
z IPv4
```
:::note
If the `schema_inference_hints` is not formatted properly, or if there is a typo or a wrong datatype, etc... the whole schema_inference_hints will be ignored.
:::
)", 0) \
DECLARE(SchemaInferenceMode, schema_inference_mode, "default", R"(
Mode of schema inference. 'default' - assume that all files have the same schema and schema can be inferred from any file, 'union' - files can have different schemas and the resulting schema should be the a union of schemas of all files
)", 0) \
DECLARE(UInt64Auto, schema_inference_make_columns_nullable, 3, R"(
Controls making inferred types `Nullable` in schema inference.
Possible values:
* 0 - the inferred type will never be `Nullable` (use input_format_null_as_default to control what do do with null values in this case),
* 1 - all inferred types will be `Nullable`,
* 2 or `auto` - the inferred type will be `Nullable` only if the column contains `NULL` in a sample that is parsed during schema inference or file metadata contains information about column nullability,
* 3 - the inferred type nullability will match file metadata if the format has it (e.g. Parquet), always Nullable otherwise (e.g. CSV).
)", 0) \
DECLARE(Bool, schema_inference_make_json_columns_nullable, 0, R"(
Controls making inferred JSON types `Nullable` in schema inference.
If this setting is enabled together with schema_inference_make_columns_nullable, inferred JSON type will be `Nullable`.
)", 0) \
DECLARE(Bool, input_format_json_read_bools_as_numbers, true, R"(
Allow parsing bools as numbers in JSON input formats.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_read_bools_as_strings, true, R"(
Allow parsing bools as strings in JSON input formats.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_try_infer_numbers_from_strings, false, R"(
If enabled, during schema inference ClickHouse will try to infer numbers from string fields.
It can be useful if JSON data contains quoted UInt64 numbers.
Disabled by default.
)", 0) \
DECLARE(Bool, input_format_json_validate_types_from_metadata, true, R"(
For JSON/JSONCompact/JSONColumnsWithMetadata input formats, if this setting is set to 1,
the types from metadata in input data will be compared with the types of the corresponding columns from the table.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_read_numbers_as_strings, true, R"(
Allow parsing numbers as strings in JSON input formats.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_read_objects_as_strings, true, R"(
Allow parsing JSON objects as strings in JSON input formats.
Example:
```sql
SET input_format_json_read_objects_as_strings = 1;
CREATE TABLE test (id UInt64, obj String, date Date) ENGINE=Memory();
INSERT INTO test FORMAT JSONEachRow {"id" : 1, "obj" : {"a" : 1, "b" : "Hello"}, "date" : "2020-01-01"};
SELECT * FROM test;
```
Result:
```
┌─id─┬─obj──────────────────────┬───────date─┐
│ 1 │ {"a" : 1, "b" : "Hello"} │ 2020-01-01 │
└────┴──────────────────────────┴────────────┘
```
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_read_arrays_as_strings, true, R"(
Allow parsing JSON arrays as strings in JSON input formats.
Example:
```sql
SET input_format_json_read_arrays_as_strings = 1;
SELECT arr, toTypeName(arr), JSONExtractArrayRaw(arr)[3] from format(JSONEachRow, 'arr String', '{"arr" : [1, "Hello", [1,2,3]]}');
```
Result:
```
┌─arr───────────────────┬─toTypeName(arr)─┬─arrayElement(JSONExtractArrayRaw(arr), 3)─┐
│ [1, "Hello", [1,2,3]] │ String │ [1,2,3] │
└───────────────────────┴─────────────────┴───────────────────────────────────────────┘
```
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_try_infer_named_tuples_from_objects, true, R"(
If enabled, during schema inference ClickHouse will try to infer named Tuple from JSON objects.
The resulting named Tuple will contain all elements from all corresponding JSON objects from sample data.
Example:
```sql
SET input_format_json_try_infer_named_tuples_from_objects = 1;
DESC format(JSONEachRow, '{"obj" : {"a" : 42, "b" : "Hello"}}, {"obj" : {"a" : 43, "c" : [1, 2, 3]}}, {"obj" : {"d" : {"e" : 42}}}')
```
Result:
```
┌─name─┬─type───────────────────────────────────────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ obj │ Tuple(a Nullable(Int64), b Nullable(String), c Array(Nullable(Int64)), d Tuple(e Nullable(Int64))) │ │ │ │ │ │
└──────┴────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
```
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_infer_array_of_dynamic_from_array_of_different_types, true, R"(
If enabled, during schema inference ClickHouse will use Array(Dynamic) type for JSON arrays with values of different data types.
Example:
```sql
SET input_format_json_infer_array_of_dynamic_from_array_of_different_types=1;
DESC format(JSONEachRow, '{"a" : [42, "hello", [1, 2, 3]]}');
```
```response
┌─name─┬─type───────────┐
│ a │ Array(Dynamic) │
└──────┴────────────────┘
```
```sql
SET input_format_json_infer_array_of_dynamic_from_array_of_different_types=0;
DESC format(JSONEachRow, '{"a" : [42, "hello", [1, 2, 3]]}');
```
```response
┌─name─┬─type─────────────────────────────────────────────────────────────┐
│ a │ Tuple(Nullable(Int64), Nullable(String), Array(Nullable(Int64))) │
└──────┴──────────────────────────────────────────────────────────────────┘
```
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_use_string_type_for_ambiguous_paths_in_named_tuples_inference_from_objects, false, R"(
Use String type instead of an exception in case of ambiguous paths in JSON objects during named tuples inference
)", 0) \
DECLARE(Bool, input_format_json_infer_incomplete_types_as_strings, true, R"(
Allow to use String type for JSON keys that contain only `Null`/`{}`/`[]` in data sample during schema inference.
In JSON formats any value can be read as String, and we can avoid errors like `Cannot determine type for column 'column_name' by first 25000 rows of data, most likely this column contains only Nulls or empty Arrays/Maps` during schema inference
by using String type for keys with unknown types.
Example:
```sql
SET input_format_json_infer_incomplete_types_as_strings = 1, input_format_json_try_infer_named_tuples_from_objects = 1;
DESCRIBE format(JSONEachRow, '{"obj" : {"a" : [1,2,3], "b" : "hello", "c" : null, "d" : {}, "e" : []}}');
SELECT * FROM format(JSONEachRow, '{"obj" : {"a" : [1,2,3], "b" : "hello", "c" : null, "d" : {}, "e" : []}}');
```
Result:
```
┌─name─┬─type───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ obj │ Tuple(a Array(Nullable(Int64)), b Nullable(String), c Nullable(String), d Nullable(String), e Array(Nullable(String))) │ │ │ │ │ │
└──────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
┌─obj────────────────────────────┐
│ ([1,2,3],'hello',NULL,'{}',[]) │
└────────────────────────────────┘
```
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_named_tuples_as_objects, true, R"(
Parse named tuple columns as JSON objects.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_ignore_unknown_keys_in_named_tuple, true, R"(
Ignore unknown keys in json object for named tuples.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_defaults_for_missing_elements_in_named_tuple, true, R"(
Insert default values for missing elements in JSON object while parsing named tuple.
This setting works only when setting `input_format_json_named_tuples_as_objects` is enabled.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_throw_on_bad_escape_sequence, true, R"(
Throw an exception if JSON string contains bad escape sequence in JSON input formats. If disabled, bad escape sequences will remain as is in the data.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_json_ignore_unnecessary_fields, true, R"(
Ignore unnecessary fields and not parse them. Enabling this may not throw exceptions on json strings of invalid format or with duplicated fields
)", 0) \
DECLARE(Bool, input_format_try_infer_variants, false, R"(
If enabled, ClickHouse will try to infer type [`Variant`](../../sql-reference/data-types/variant.md) in schema inference for text formats when there is more than one possible type for column/array elements.
Possible values:
- 0 — Disabled.
- 1 — Enabled.
)", 0) \
DECLARE(Bool, type_json_skip_duplicated_paths, false, R"(
When enabled, during parsing JSON object into JSON type duplicated paths will be ignored and only the first one will be inserted instead of an exception
)", 0) \
DECLARE(Bool, type_json_allow_duplicated_key_with_literal_and_nested_object, true, R"(
When enabled, JSONs like `{"a" : 42, "a" : {"b" : 42}}` where some key is duplicated but one of them is a nested object are allowed to be parsed.
)", 0) \
DECLARE(Bool, type_json_use_partial_match_to_skip_paths_by_regexp, true, R"(
When enabled, during parsing JSON object into JSON type regular expressions specified using SKIP REGEXP will require partial match to skip a path. When disabled, full match will be required.
)", 0) \
DECLARE(Bool, json_type_escape_dots_in_keys, false, R"(
When enabled, dots in JSON keys will be escaped during parsing.
)", 0) \
DECLARE(UInt64, input_format_json_max_depth, 1000, R"(
Maximum depth of a field in JSON. This is not a strict limit, it does not have to be applied precisely.
)", 0) \
DECLARE(Bool, input_format_json_empty_as_default, false, R"(
When enabled, replace empty input fields in JSON with default values. For complex default expressions `input_format_defaults_for_omitted_fields` must be enabled too.
Possible values:
+ 0 — Disable.
+ 1 — Enable.
)", 0) \
DECLARE(Bool, type_json_skip_invalid_typed_paths, false, R"(
When enabled, fields with values that cannot be coerced to their declared type in JSON type columns with typed paths are skipped instead of throwing an error. Skipped fields are treated as missing and will use default/null values based on the typed path definition.
This setting only applies to JSON type columns (e.g., JSON(a Int64, b String)) where specific paths have declared types. It does not apply to regular JSON input formats like JSONEachRow when inserting into regular typed columns.
Possible values:
+ 0 — Disable (throw error on type mismatch).
+ 1 — Enable (skip field on type mismatch).
)", 0) \
DECLARE(UInt64Auto, max_dynamic_subcolumns_in_json_type_parsing, "auto", R"(
The maximum number of dynamic subcolumns that can be created in every column during parsing of JSON column.
It allows to control the number of dynamic subcolumns during parsing regardless of dynamic parameters specified in the data type.
)", 0) \
DECLARE(Bool, input_format_try_infer_integers, true, R"(
If enabled, ClickHouse will try to infer integers instead of floats in schema inference for text formats. If all numbers in the column from input data are integers, the result type will be `Int64`, if at least one number is float, the result type will be `Float64`.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_try_infer_dates, true, R"(
If enabled, ClickHouse will try to infer type `Date` from string fields in schema inference for text formats. If all fields from a column in input data were successfully parsed as dates, the result type will be `Date`, if at least one field was not parsed as date, the result type will be `String`.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_try_infer_datetimes, true, R"(
If enabled, ClickHouse will try to infer type `DateTime64` from string fields in schema inference for text formats. If all fields from a column in input data were successfully parsed as datetimes, the result type will be `DateTime64`, if at least one field was not parsed as datetime, the result type will be `String`.
Enabled by default.
)", 0) \
DECLARE(Bool, input_format_try_infer_datetimes_only_datetime64, false, R"(
When input_format_try_infer_datetimes is enabled, infer only DateTime64 but not DateTime types
)", 0) \
DECLARE(Bool, input_format_try_infer_exponent_floats, false, R"(
Try to infer floats in exponential notation while schema inference in text formats (except JSON, where exponent numbers are always inferred)
)", 0) \
DECLARE(Bool, output_format_markdown_escape_special_characters, false, R"(
When enabled, escape special characters in Markdown.
[Common Mark](https://spec.commonmark.org/0.30/#example-12) defines the following special characters that can be escaped by \:
```
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
```
Possible values:
+ 0 — Disable.
+ 1 — Enable.
)", 0) \
DECLARE(Bool, input_format_protobuf_flatten_google_wrappers, false, R"(
Enable Google wrappers for regular non-nested columns, e.g. google.protobuf.StringValue 'str' for String column 'str'. For Nullable columns empty wrappers are recognized as defaults, and missing as nulls
)", 0) \
DECLARE(Bool, output_format_protobuf_nullables_with_google_wrappers, false, R"(
When serializing Nullable columns with Google wrappers, serialize default values as empty wrappers. If turned off, default and null values are not serialized
)", 0) \
DECLARE(UInt64, input_format_csv_skip_first_lines, 0, R"(
Skip specified number of lines at the beginning of data in CSV format
)", 0) \
DECLARE(UInt64, input_format_tsv_skip_first_lines, 0, R"(
Skip specified number of lines at the beginning of data in TSV format
)", 0) \
DECLARE(Bool, input_format_csv_skip_trailing_empty_lines, false, R"(
Skip trailing empty lines in CSV format
)", 0) \
DECLARE(Bool, input_format_tsv_skip_trailing_empty_lines, false, R"(
Skip trailing empty lines in TSV format
)", 0) \
DECLARE(Bool, input_format_custom_skip_trailing_empty_lines, false, R"(
Skip trailing empty lines in CustomSeparated format
)", 0) \
DECLARE(Bool, input_format_tsv_crlf_end_of_line, false, R"(
If it is set true, file function will read TSV format with \\r\\n instead of \\n.
)", 0) \
\
DECLARE(Bool, input_format_native_allow_types_conversion, true, R"(
Allow data types conversion in Native input format
)", 0) \
DECLARE(Bool, input_format_native_decode_types_in_binary_format, false, R"(
Read data types in binary format instead of type names in Native input format
)", 0) \
DECLARE(UInt64, output_format_compression_level, 3, R"(
Default compression level if query output is compressed. The setting is applied when `SELECT` query has `INTO OUTFILE` or when writing to table functions `file`, `url`, `hdfs`, `s3`, or `azureBlobStorage`.
Possible values: from `1` to `22`
)", 0) \
DECLARE(UInt64, output_format_compression_zstd_window_log, 0, R"(
Can be used when the output compression method is `zstd`. If greater than `0`, this setting explicitly sets compression window size (power of `2`) and enables a long-range mode for zstd compression. This can help to achieve a better compression ratio.
Possible values: non-negative numbers. Note that if the value is too small or too big, `zstdlib` will throw an exception. Typical values are from `20` (window size = `1MB`) to `30` (window size = `1GB`).
)", 0) \
DECLARE(Bool, output_format_native_encode_types_in_binary_format, false, R"(
Write data types in binary format instead of type names in Native output format
)", 0) \
DECLARE(Bool, output_format_native_write_json_as_string, false, R"(
Write data of [JSON](../../sql-reference/data-types/newjson.md) column as [String](../../sql-reference/data-types/string.md) column containing JSON strings instead of default native JSON serialization.
)", 0) \
DECLARE(Bool, output_format_native_use_flattened_dynamic_and_json_serialization, false, R"(
Write data of [JSON](../../sql-reference/data-types/newjson.md) and [Dynamic](../../sql-reference/data-types/dynamic.md) columns in a flattened format (all types/paths as separate subcolumns).
)", 0) \
\
DECLARE(DateTimeInputFormat, date_time_input_format, FormatSettings::DateTimeInputFormat::BestEffort, R"(
Allows choosing a parser of the text representation of date and time.
The setting does not apply to [date and time functions](../../sql-reference/functions/date-time-functions.md).
Possible values:
- `'best_effort'` — Enables extended parsing.
ClickHouse can parse the basic `YYYY-MM-DD HH:MM:SS` format and all [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time formats. For example, `'2018-06-08T01:02:03.000Z'`.
- `'best_effort_us'` — Similar to `best_effort` (see the difference in [parseDateTimeBestEffortUS](../../sql-reference/functions/type-conversion-functions#parseDateTimeBestEffortUS)
- `'basic'` — Use basic parser.
ClickHouse can parse only the basic `YYYY-MM-DD HH:MM:SS` or `YYYY-MM-DD` format. For example, `2019-08-20 10:18:56` or `2019-08-20`.
See also:
- [DateTime data type.](../../sql-reference/data-types/datetime.md)
- [Functions for working with dates and times.](../../sql-reference/functions/date-time-functions.md)
)", 0) \
DECLARE(DateTimeOutputFormat, date_time_output_format, FormatSettings::DateTimeOutputFormat::Simple, R"(
Allows choosing different output formats of the text representation of date and time.
Possible values:
- `simple` - Simple output format.
ClickHouse output date and time `YYYY-MM-DD hh:mm:ss` format. For example, `2019-08-20 10:18:56`. The calculation is performed according to the data type's time zone (if present) or server time zone.
- `iso` - ISO output format.
ClickHouse output date and time in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) `YYYY-MM-DDThh:mm:ssZ` format. For example, `2019-08-20T10:18:56Z`. Note that output is in UTC (`Z` means UTC).
- `unix_timestamp` - Unix timestamp output format.
ClickHouse output date and time in [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) format. For example `1566285536`.
See also:
- [DateTime data type.](../../sql-reference/data-types/datetime.md)
- [Functions for working with dates and times.](../../sql-reference/functions/date-time-functions.md)
)", 0) \
DECLARE(IntervalOutputFormat, interval_output_format, FormatSettings::IntervalOutputFormat::Numeric, R"(
Allows choosing different output formats of the text representation of interval types.
Possible values:
- `kusto` - KQL-style output format.
ClickHouse outputs intervals in [KQL format](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings#the-constant-c-format-specifier). For example, `toIntervalDay(2)` would be formatted as `2.00:00:00`. Please note that for interval types of varying length (ie. `IntervalMonth` and `IntervalYear`) the average number of seconds per interval is taken into account.
- `numeric` - Numeric output format.
ClickHouse outputs intervals as their underlying numeric representation. For example, `toIntervalDay(2)` would be formatted as `2`.
See also:
- [Interval](../../sql-reference/data-types/special-data-types/interval.md)
)", 0) \
\
DECLARE(Bool, date_time_64_output_format_cut_trailing_zeros_align_to_groups_of_thousands, false, R"(
Dynamically trim the trailing zeros of datetime64 values to adjust the output scale to [0, 3, 6],
corresponding to 'seconds', 'milliseconds', and 'microseconds')", 0) \
DECLARE(Bool, input_format_ipv4_default_on_conversion_error, false, R"(
Deserialization of IPv4 will use default values instead of throwing exception on conversion error.
Disabled by default.
)", 0) \
DECLARE(Bool, input_format_ipv6_default_on_conversion_error, false, R"(
Deserialization of IPV6 will use default values instead of throwing exception on conversion error.
Disabled by default.
)", 0) \
DECLARE(Bool, check_conversion_from_numbers_to_enum, true, R"(
Throw an exception during Numbers to Enum conversion if the value does not exist in Enum.
Possible values:
- 0 — Disabled.
- 1 — Enabled.
**Example**
```text
CREATE TABLE tab (
val Enum('first' = 1, 'second' = 2, 'third' = 3)
) ENGINE = Memory;
INSERT INTO tab SETTINGS check_conversion_from_numbers_to_enum = 1 VALUES (4); -- returns an error
```
)", 0) \
DECLARE(String, bool_true_representation, "true", R"(
Text to represent true bool value in TSV/CSV/Vertical/Pretty formats.
)", 0) \
DECLARE(String, bool_false_representation, "false", R"(
Text to represent false bool value in TSV/CSV/Vertical/Pretty formats.
)", 0) \
\
DECLARE(Bool, allow_special_bool_values_inside_variant, false, R"(
Allows to parse Bool values inside Variant type from special text bool values like "on", "off", "enable", "disable", etc.
)", 0) \
\
DECLARE(Bool, input_format_values_interpret_expressions, true, R"(
For Values format: if the field could not be parsed by streaming parser, run SQL parser and try to interpret it as SQL expression.
)", 0) \
DECLARE(Bool, input_format_values_deduce_templates_of_expressions, true, R"(
For Values format: if the field could not be parsed by streaming parser, run SQL parser, deduce template of the SQL expression, try to parse all rows using template and then interpret expression for all rows.
)", 0) \
DECLARE(Bool, input_format_values_accurate_types_of_literals, true, R"(
For Values format: when parsing and interpreting expressions using template, check actual type of literal to avoid possible overflow and precision issues.
)", 0) \
DECLARE(Bool, input_format_avro_allow_missing_fields, false, R"(
For Avro/AvroConfluent format: when field is not found in schema use default value instead of error
)", 0) \
/** This setting is obsolete and do nothing, left for compatibility reasons. */ \
DECLARE(Bool, input_format_avro_null_as_default, false, R"(
For Avro/AvroConfluent format: insert default in case of null and non Nullable column
)", 0) \
DECLARE(UInt64, format_binary_max_string_size, 1_GiB, R"(
The maximum allowed size for String in RowBinary format. It prevents allocating large amount of memory in case of corrupted data. 0 means there is no limit
)", 0) \
DECLARE(UInt64, format_binary_max_array_size, 1_GiB, R"(
The maximum allowed size for Array in RowBinary format. It prevents allocating large amount of memory in case of corrupted data. 0 means there is no limit
)", 0) \
DECLARE(UInt64, input_format_binary_max_type_complexity, 1000, R"(
Max type nodes when decoding binary types (not depth, but total count). `Map(String, UInt32)` = 3 nodes. Protects against malicious inputs. 0 = unlimited.
)", 0) \
DECLARE(UInt64, format_binary_max_object_size, 100000, R"(
The maximum allowed number of paths in a single Object for JSON type RowBinary format. It prevents allocating large amount of memory in case of corrupted data. 0 means there is no limit
)", 0) \
DECLARE(Bool, input_format_binary_decode_types_in_binary_format, false, R"(
Read data types in binary format instead of type names in RowBinaryWithNamesAndTypes input format
)", 0) \
DECLARE(Bool, output_format_binary_encode_types_in_binary_format, false, R"(
Write data types in binary format instead of type names in RowBinaryWithNamesAndTypes output format
)", 0) \
DECLARE(URI, format_avro_schema_registry_url, "", R"(
For AvroConfluent format: Confluent Schema Registry URL.
)", 0) \
DECLARE(UInt64, format_avro_schema_registry_connection_timeout, 1, R"(
For AvroConfluent format: connection timeout in seconds for the Confluent Schema Registry HTTP client. Used by both schema fetch and schema registration. Must be greater than 0 and less than 600 (10 minutes).
)", 0) \
DECLARE(UInt64, format_avro_schema_registry_send_timeout, 1, R"(
For AvroConfluent format: send timeout in seconds for the Confluent Schema Registry HTTP client. Used by both schema fetch and schema registration. Must be greater than 0 and less than 600 (10 minutes).
)", 0) \
DECLARE(UInt64, format_avro_schema_registry_receive_timeout, 1, R"(
For AvroConfluent format: receive timeout in seconds for the Confluent Schema Registry HTTP client. Used by both schema fetch and schema registration. Must be greater than 0 and less than 600 (10 minutes).
)", 0) \
DECLARE(UInt64, format_avro_schema_registry_max_retries, 5, R"(
For AvroConfluent format: maximum number of retries for transient failures when communicating with the Confluent Schema Registry (transport timeouts, connection refused, DNS errors, HTTP 5xx/408/429). Set to 0 to disable retries. The maximum allowed value is 20. Schema validation errors (HTTP 409, malformed Avro JSON) are not retried.
)", 0) \
DECLARE(UInt64, format_avro_schema_registry_retry_initial_backoff_ms, 100, R"(
For AvroConfluent format: initial backoff in milliseconds before retrying a failed Confluent Schema Registry request. The backoff doubles on each subsequent retry, capped at 10 seconds. Must be greater than 0 and less than or equal to 60000.
)", 0) \
DECLARE(Bool, input_format_binary_read_json_as_string, false, R"(
Read values of [JSON](../../sql-reference/data-types/newjson.md) data type as JSON [String](../../sql-reference/data-types/string.md) values in RowBinary input format.
)", 0) \
DECLARE(Bool, output_format_binary_write_json_as_string, false, R"(
Write values of [JSON](../../sql-reference/data-types/newjson.md) data type as JSON [String](../../sql-reference/data-types/string.md) values in RowBinary output format.
)", 0) \
\
DECLARE(Bool, output_format_json_quote_64bit_integers, false, R"(
Controls quoting of 64-bit or bigger [integers](../../sql-reference/data-types/int-uint.md) (like `UInt64` or `Int128`) when they are output in a [JSON](/interfaces/formats/JSON) format.
Such integers are enclosed in quotes by default. This behavior is compatible with most JavaScript implementations.
Possible values:
- 0 — Integers are output without quotes.
- 1 — Integers are enclosed in quotes.
)", 0) \
DECLARE(Bool, output_format_json_quote_denormals, false, R"str(
Enables `+nan`, `-nan`, `+inf`, `-inf` outputs in [JSON](/interfaces/formats/JSON) output format.
Possible values:
- 0 — Disabled.
- 1 — Enabled.
**Example**
Consider the following table `account_orders`:
```text
┌─id─┬─name───┬─duration─┬─period─┬─area─┐
│ 1 │ Andrew │ 20 │ 0 │ 400 │
│ 2 │ John │ 40 │ 0 │ 0 │
│ 3 │ Bob │ 15 │ 0 │ -100 │
└────┴────────┴──────────┴────────┴──────┘
```
When `output_format_json_quote_denormals = 0`, the query returns `null` values in output:
```sql
SELECT area/period FROM account_orders FORMAT JSON;
```
```json
{
"meta":
[
{
"name": "divide(area, period)",
"type": "Float64"
}
],
"data":
[
{
"divide(area, period)": null
},
{
"divide(area, period)": null
},
{
"divide(area, period)": null
}
],
"rows": 3,
"statistics":
{
"elapsed": 0.003648093,
"rows_read": 3,
"bytes_read": 24
}
}
```
When `output_format_json_quote_denormals = 1`, the query returns:
```json
{
"meta":
[
{
"name": "divide(area, period)",
"type": "Float64"
}
],
"data":
[
{
"divide(area, period)": "inf"
},
{
"divide(area, period)": "-nan"
},
{
"divide(area, period)": "-inf"
}
],
"rows": 3,
"statistics":
{
"elapsed": 0.000070241,
"rows_read": 3,
"bytes_read": 24
}
}
```
)str", 0) \
DECLARE(Bool, output_format_json_quote_decimals, false, R"(
Controls quoting of decimals in JSON output formats.
Disabled by default.
)", 0) \
DECLARE(Bool, output_format_json_quote_64bit_floats, false, R"(
Controls quoting of 64-bit [floats](../../sql-reference/data-types/float.md) when they are output in JSON* formats.
Disabled by default.
)", 0) \
\
DECLARE(Bool, output_format_json_escape_forward_slashes, true, R"(
Controls escaping forward slashes for string outputs in JSON output format. This is intended for compatibility with JavaScript. Don't confuse with backslashes that are always escaped.
Enabled by default.
)", 0) \
DECLARE(Bool, output_format_json_named_tuples_as_objects, true, R"(
Serialize named tuple columns as JSON objects.
Enabled by default.
)", 0) \
DECLARE(Bool, output_format_json_skip_null_value_in_named_tuples, false, R"(
Skip key value pairs with null value when serialize named tuple columns as JSON objects. It is only valid when output_format_json_named_tuples_as_objects is true.
)", 0) \
DECLARE(Bool, output_format_json_array_of_rows, false, R"(
Enables the ability to output all rows as a JSON array in the [JSONEachRow](/interfaces/formats/JSONEachRow) format.
Possible values:
- 1 — ClickHouse outputs all rows as an array, each row in the `JSONEachRow` format.
- 0 — ClickHouse outputs each row separately in the `JSONEachRow` format.
**Example of a query with the enabled setting**
Query:
```sql