diff options
author | dinmukhammed <dinmukhammed@yandex-team.ru> | 2022-02-21 19:49:10 +0300 |
---|---|---|
committer | dinmukhammed <dinmukhammed@yandex-team.ru> | 2022-02-21 19:49:10 +0300 |
commit | ba303e94a7c1791a2ad4360013f0502dfc2f35ef (patch) | |
tree | 0b4cfa7d4bc4c637434606a67c068f97834a66cf | |
parent | 2f0079f4dba621c768df7e1973769707189e3656 (diff) | |
download | ydb-ba303e94a7c1791a2ad4360013f0502dfc2f35ef.tar.gz |
YQ-893 Formatting JSONEachRow -> json_each_row
JSONEachRow
ref:54c1c90ed38cf0e7bd6c5cf4cfa3993c8cd62db4
-rw-r--r-- | ydb/library/yql/udfs/common/clickhouse/client/src/Core/Settings.h | 8 | ||||
-rw-r--r-- | ydb/library/yql/udfs/common/clickhouse/client/src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/ydb/library/yql/udfs/common/clickhouse/client/src/Core/Settings.h b/ydb/library/yql/udfs/common/clickhouse/client/src/Core/Settings.h index 09dfd347423..615a4d749b6 100644 --- a/ydb/library/yql/udfs/common/clickhouse/client/src/Core/Settings.h +++ b/ydb/library/yql/udfs/common/clickhouse/client/src/Core/Settings.h @@ -535,10 +535,10 @@ class IColumn; M(Bool, input_format_csv_unquoted_null_literal_as_null, false, "Consider unquoted NULL literal as \\N", 0) \ M(Bool, input_format_csv_enum_as_number, false, "Treat inserted enum values in CSV formats as enum indices \\N", 0) \ M(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) \ - M(Bool, input_format_skip_unknown_fields, false, "Skip columns with unknown names from input data (it works for JSONEachRow, CSVWithNames, TSVWithNames and TSKV formats).", 0) \ + M(Bool, input_format_skip_unknown_fields, false, "Skip columns with unknown names from input data (it works for json_each_row, CSVWithNames, TSVWithNames and TSKV formats).", 0) \ M(Bool, input_format_with_names_use_header, true, "For TSVWithNames and CSVWithNames input formats this controls whether format parser is to assume that column data appear in the input exactly as they are specified in the header.", 0) \ - M(Bool, input_format_import_nested_json, false, "Map nested JSON data to nested tables (it works for JSONEachRow format).", 0) \ - M(Bool, input_format_defaults_for_omitted_fields, true, "For input data calculate default expressions for omitted fields (it works for JSONEachRow, CSV and TSV formats).", IMPORTANT) \ + M(Bool, input_format_import_nested_json, false, "Map nested JSON data to nested tables (it works for json_each_row format).", 0) \ + M(Bool, input_format_defaults_for_omitted_fields, true, "For input data calculate default expressions for omitted fields (it works for json_each_row, CSV and TSV formats).", IMPORTANT) \ M(Bool, input_format_tsv_empty_as_default, false, "Treat empty fields in TSV input as default values.", 0) \ M(Bool, input_format_tsv_enum_as_number, false, "Treat inserted enum values in TSV formats as enum indices \\N", 0) \ M(Bool, input_format_null_as_default, true, "For text input formats initialize null fields with default values if data type of this field is not nullable", 0) \ @@ -562,7 +562,7 @@ class IColumn; \ M(Bool, output_format_json_escape_forward_slashes, true, "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.", 0) \ M(Bool, output_format_json_named_tuples_as_objects, false, "Serialize named tuple columns as JSON objects.", 0) \ - M(Bool, output_format_json_array_of_rows, false, "Output a JSON array of all rows in JSONEachRow(Compact) format.", 0) \ + M(Bool, output_format_json_array_of_rows, false, "Output a JSON array of all rows in json_each_row(Compact) format.", 0) \ \ M(UInt64, output_format_pretty_max_rows, 10000, "Rows limit for Pretty formats.", 0) \ M(UInt64, output_format_pretty_max_column_pad_width, 250, "Maximum width to pad all values in a column in Pretty formats.", 0) \ diff --git a/ydb/library/yql/udfs/common/clickhouse/client/src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp b/ydb/library/yql/udfs/common/clickhouse/client/src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp index 61034a8e01b..32319bef682 100644 --- a/ydb/library/yql/udfs/common/clickhouse/client/src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp +++ b/ydb/library/yql/udfs/common/clickhouse/client/src/Processors/Formats/Impl/JSONEachRowRowInputFormat.cpp @@ -126,7 +126,7 @@ static inline void skipColonDelimeter(ReadBuffer & istr) void JSONEachRowRowInputFormat::skipUnknownField(const StringRef & name_ref) { if (!format_settings.skip_unknown_fields) - throw Exception("Unknown field found while parsing JSONEachRow format: " + name_ref.toString(), ErrorCodes::INCORRECT_DATA); + throw Exception("Unknown field found while parsing json_each_row format: " + name_ref.toString(), ErrorCodes::INCORRECT_DATA); skipJSONField(in, name_ref); } @@ -134,7 +134,7 @@ void JSONEachRowRowInputFormat::skipUnknownField(const StringRef & name_ref) void JSONEachRowRowInputFormat::readField(size_t index, MutableColumns & columns) { if (seen_columns[index]) - throw Exception("Duplicate field found while parsing JSONEachRow format: " + columnName(index), ErrorCodes::INCORRECT_DATA); + throw Exception("Duplicate field found while parsing json_each_row format: " + columnName(index), ErrorCodes::INCORRECT_DATA); try { @@ -174,7 +174,7 @@ inline bool JSONEachRowRowInputFormat::advanceToNextKey(size_t key_index) skipWhitespaceIfAny(in); if (in.eof()) - throw ParsingException("Unexpected end of stream while parsing JSONEachRow format", ErrorCodes::CANNOT_READ_ALL_DATA); + throw ParsingException("Unexpected end of stream while parsing json_each_row format", ErrorCodes::CANNOT_READ_ALL_DATA); else if (*in.position() == '}') { ++in.position(); @@ -334,7 +334,7 @@ void JSONEachRowRowInputFormat::readSuffix() void registerInputFormatProcessorJSONEachRow(FormatFactory & factory) { - factory.registerInputFormatProcessor("JSONEachRow", []( + factory.registerInputFormatProcessor("json_each_row", []( ReadBuffer & buf, const Block & sample, IRowInputFormat::Params params, @@ -355,13 +355,13 @@ void registerInputFormatProcessorJSONEachRow(FormatFactory & factory) void registerFileSegmentationEngineJSONEachRow(FormatFactory & factory) { - factory.registerFileSegmentationEngine("JSONEachRow", &fileSegmentationEngineJSONEachRowImpl); + factory.registerFileSegmentationEngine("json_each_row", &fileSegmentationEngineJSONEachRowImpl); factory.registerFileSegmentationEngine("JSONStringsEachRow", &fileSegmentationEngineJSONEachRowImpl); } void registerNonTrivialPrefixAndSuffixCheckerJSONEachRow(FormatFactory & factory) { - factory.registerNonTrivialPrefixAndSuffixChecker("JSONEachRow", nonTrivialPrefixAndSuffixCheckerJSONEachRowImpl); + factory.registerNonTrivialPrefixAndSuffixChecker("json_each_row", nonTrivialPrefixAndSuffixCheckerJSONEachRowImpl); factory.registerNonTrivialPrefixAndSuffixChecker("JSONStringsEachRow", nonTrivialPrefixAndSuffixCheckerJSONEachRowImpl); } |