Minor edit docs / add int256 test

This commit is contained in:
Dmitry Kardymon 2023-06-19 09:51:29 +00:00
parent 30bea857fd
commit dd43a186ad
6 changed files with 14 additions and 14 deletions

View File

@ -471,7 +471,7 @@ The CSV format supports the output of totals and extremes the same way as `TabSe
- [input_format_csv_skip_trailing_empty_lines](/docs/en/operations/settings/settings-formats.md/#input_format_csv_skip_trailing_empty_lines) - skip trailing empty lines at the end of data. Default value - `false`.
- [input_format_csv_trim_whitespaces](/docs/en/operations/settings/settings-formats.md/#input_format_csv_trim_whitespaces) - trim spaces and tabs in non-quoted CSV strings. Default value - `true`.
- [input_format_csv_allow_whitespace_or_tab_as_delimiter](/docs/en/operations/settings/settings-formats.md/# input_format_csv_allow_whitespace_or_tab_as_delimiter) - Allow to use whitespace or tab as field delimiter in CSV strings. Default value - `false`.
- [input_format_csv_ignore_extra_columns](/docs/en/operations/settings/settings-formats.md/#input_format_csv_ignore_extra_columns) - ignore extra columns in CSV input (if your file has more columns than expected). Default value - `false`.
- [input_format_csv_ignore_extra_columns](/docs/en/operations/settings/settings-formats.md/#input_format_csv_ignore_extra_columns) - ignore extra columns in CSV input (if file has more columns than expected). Default value - `false`.
- [input_format_csv_missing_as_default](/docs/en/operations/settings/settings-formats.md/#input_format_csv_missing_as_default) - treat missing fields in CSV input as default values. Default value - `false`.
## CSVWithNames {#csvwithnames}

View File

@ -933,7 +933,7 @@ Result
```
### input_format_csv_ignore_extra_columns {#input_format_csv_ignore_extra_columns}
Ignore extra columns in CSV input (if your file has more columns than expected).
Ignore extra columns in CSV input (if file has more columns than expected).
Disabled by default.

View File

@ -1005,7 +1005,7 @@ class IColumn;
M(Bool, regexp_dict_allow_hyperscan, true, "Allow regexp_tree dictionary using Hyperscan library.", 0) \
\
M(Bool, dictionary_use_async_executor, false, "Execute a pipeline for reading from a dictionary with several threads. It's supported only by DIRECT dictionary with CLICKHOUSE source.", 0) \
M(Bool, input_format_csv_ignore_extra_columns, false, "Ignore extra columns in CSV input (if your file has more columns than expected)", 0) \
M(Bool, input_format_csv_ignore_extra_columns, false, "Ignore extra columns in CSV input (if file has more columns than expected)", 0) \
M(Bool, input_format_csv_missing_as_default, false, "Treat missing fields in CSV input as default values", 0) \
// End of FORMAT_FACTORY_SETTINGS

View File

@ -346,7 +346,7 @@ bool CSVFormatReader::readField(
while (checkChar(format_settings.csv.delimiter, *buf))
{
skipField();
skipWhitespacesAndTabs(*buf);
skipWhitespacesAndTabs(*buf, format_settings.csv.allow_whitespace_or_tab_as_delimiter);
}
}
return res;

View File

@ -22,8 +22,8 @@ Hello 4 String4
Hello 5 String5
Hello 6 String6
=== Test input_format_csv_missing_as_default
Hello 0 33 \N 55 Default
Hello 0 33 \N 55 Default
Hello 1 2 \N 55 Default
Hello 1 2 3 4 String
Hello 1 2 3 4 String
Hello 0 0 33 \N 55 Default
Hello 0 0 33 \N 55 Default
Hello 1 3 2 \N 55 Default
Hello 1 4 2 3 4 String
Hello 1 5 2 3 4 String

View File

@ -56,12 +56,12 @@ $CLICKHOUSE_CLIENT --query="DROP TABLE csv";
echo === Test input_format_csv_missing_as_default
$CLICKHOUSE_CLIENT --query="CREATE TABLE csv (f1 String, f2 UInt64, f3 UInt64 Default 33, f4 Nullable(UInt64), f5 Nullable(UInt64) Default 55, f6 String DEFAULT 'Default') ENGINE = Memory";
$CLICKHOUSE_CLIENT --query="CREATE TABLE csv (f1 String, f2 UInt64, f3 UInt256, f4 UInt64 Default 33, f5 Nullable(UInt64), f6 Nullable(UInt64) Default 55, f7 String DEFAULT 'Default') ENGINE = Memory";
echo 'Hello
Hello,
Hello, 1, 2
Hello, 1, 2, 3, 4, String
Hello, 1, 2, 3, 4, String,'| $CLICKHOUSE_CLIENT --input_format_defaults_for_omitted_fields=1 --input_format_csv_empty_as_default=1 --input_format_csv_missing_as_default=1 --query="INSERT INTO csv FORMAT CSV";
$CLICKHOUSE_CLIENT --query="SELECT * FROM csv ORDER BY f1, f2, f3, f4 NULLS FIRST, f5, f6";
Hello, 1, 3, 2
Hello, 1, 4, 2, 3, 4, String
Hello, 1, 5, 2, 3, 4, String,'| $CLICKHOUSE_CLIENT --input_format_defaults_for_omitted_fields=1 --input_format_csv_missing_as_default=1 --query="INSERT INTO csv FORMAT CSV";
$CLICKHOUSE_CLIENT --query="SELECT * FROM csv ORDER BY f1, f2, f3, f4, f5 NULLS FIRST, f6, f7";
$CLICKHOUSE_CLIENT --query="DROP TABLE csv";