2018-06-05 21:39:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-08 01:51:55 +00:00
|
|
|
#include <Core/Types.h>
|
|
|
|
|
|
|
|
|
2018-06-05 21:39:01 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2018-06-08 01:51:55 +00:00
|
|
|
/** Various tweaks for input/output formats.
|
|
|
|
* Text serialization/deserialization of data types also depend on some of these settings.
|
|
|
|
* NOTE Parameters for unrelated formats and unrelated data types
|
|
|
|
* are collected in this struct - it prevents modularity, but they are difficult to separate.
|
|
|
|
*/
|
2018-06-05 21:39:01 +00:00
|
|
|
struct FormatSettings
|
|
|
|
{
|
|
|
|
struct JSON
|
|
|
|
{
|
|
|
|
bool quote_64bit_integers = true;
|
|
|
|
bool quote_denormals = true;
|
2018-08-06 14:11:58 +00:00
|
|
|
bool escape_forward_slashes = true;
|
2018-06-05 21:39:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
JSON json;
|
|
|
|
|
|
|
|
struct CSV
|
|
|
|
{
|
|
|
|
char delimiter = ',';
|
2018-07-04 21:00:50 +00:00
|
|
|
bool allow_single_quotes = true;
|
|
|
|
bool allow_double_quotes = true;
|
2019-07-18 13:43:20 +00:00
|
|
|
bool unquoted_null_literal_as_null = false;
|
2019-06-20 12:46:36 +00:00
|
|
|
bool empty_as_default = false;
|
2019-07-18 13:43:20 +00:00
|
|
|
bool null_as_default = false;
|
2018-06-05 21:39:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
CSV csv;
|
|
|
|
|
2018-06-08 01:51:55 +00:00
|
|
|
struct Pretty
|
|
|
|
{
|
|
|
|
UInt64 max_rows = 10000;
|
2018-08-30 23:34:12 +00:00
|
|
|
UInt64 max_column_pad_width = 250;
|
2018-06-08 01:51:55 +00:00
|
|
|
bool color = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
Pretty pretty;
|
|
|
|
|
|
|
|
struct Values
|
|
|
|
{
|
|
|
|
bool interpret_expressions = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
Values values;
|
|
|
|
|
|
|
|
bool skip_unknown_fields = false;
|
2019-04-22 13:31:17 +00:00
|
|
|
bool with_names_use_header = false;
|
2018-06-08 01:51:55 +00:00
|
|
|
bool write_statistics = true;
|
2018-09-14 13:43:57 +00:00
|
|
|
bool import_nested_json = false;
|
2018-06-08 01:51:55 +00:00
|
|
|
|
2018-06-05 21:39:01 +00:00
|
|
|
enum class DateTimeInputFormat
|
|
|
|
{
|
|
|
|
Basic, /// Default format for fast parsing: YYYY-MM-DD hh:mm:ss (ISO-8601 without fractional part and timezone) or NNNNNNNNNN unix timestamp.
|
|
|
|
BestEffort /// Use sophisticated rules to parse whatever possible.
|
|
|
|
};
|
|
|
|
|
|
|
|
DateTimeInputFormat date_time_input_format = DateTimeInputFormat::Basic;
|
2018-06-10 19:22:49 +00:00
|
|
|
|
|
|
|
UInt64 input_allow_errors_num = 0;
|
2019-01-07 19:56:53 +00:00
|
|
|
Float32 input_allow_errors_ratio = 0;
|
2019-02-19 20:51:44 +00:00
|
|
|
|
|
|
|
struct Parquet
|
|
|
|
{
|
|
|
|
UInt64 row_group_size = 1000000;
|
|
|
|
} parquet;
|
|
|
|
|
2018-06-05 21:39:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|