diff --git a/docs/en/sql-reference/table-functions/azureBlobStorage.md b/docs/en/sql-reference/table-functions/azureBlobStorage.md index 6936c807f96a..2eaad48d6556 100644 --- a/docs/en/sql-reference/table-functions/azureBlobStorage.md +++ b/docs/en/sql-reference/table-functions/azureBlobStorage.md @@ -87,6 +87,5 @@ When setting `use_hive_partitioning` is set to 1, ClickHouse will detect Hive-st Use virtual column, created with Hive-style partitioning ``` sql -SET use_hive_partitioning = 1; SELECT * from azureBlobStorage(config, storage_account_url='...', container='...', blob_path='http://data/path/date=*/country=*/code=*/*.parquet') where _date > '2020-01-01' and _country = 'Netherlands' and _code = 42; ``` diff --git a/docs/en/sql-reference/table-functions/file.md b/docs/en/sql-reference/table-functions/file.md index a3480dc7ee28..6ade64e9af3f 100644 --- a/docs/en/sql-reference/table-functions/file.md +++ b/docs/en/sql-reference/table-functions/file.md @@ -215,7 +215,6 @@ When setting `use_hive_partitioning` is set to 1, ClickHouse will detect Hive-st Use virtual column, created with Hive-style partitioning ``` sql -SET use_hive_partitioning = 1; SELECT * from file('data/path/date=*/country=*/code=*/*.parquet') where _date > '2020-01-01' and _country = 'Netherlands' and _code = 42; ``` diff --git a/docs/en/sql-reference/table-functions/hdfs.md b/docs/en/sql-reference/table-functions/hdfs.md index 30d2e371c7ed..11b25561f8db 100644 --- a/docs/en/sql-reference/table-functions/hdfs.md +++ b/docs/en/sql-reference/table-functions/hdfs.md @@ -109,7 +109,6 @@ When setting `use_hive_partitioning` is set to 1, ClickHouse will detect Hive-st Use virtual column, created with Hive-style partitioning ``` sql -SET use_hive_partitioning = 1; SELECT * from HDFS('hdfs://hdfs1:9000/data/path/date=*/country=*/code=*/*.parquet') where _date > '2020-01-01' and _country = 'Netherlands' and _code = 42; ``` diff --git a/docs/en/sql-reference/table-functions/s3.md b/docs/en/sql-reference/table-functions/s3.md index da8330341329..0bb65c41fd3e 100644 --- a/docs/en/sql-reference/table-functions/s3.md +++ b/docs/en/sql-reference/table-functions/s3.md @@ -310,7 +310,6 @@ When setting `use_hive_partitioning` is set to 1, ClickHouse will detect Hive-st Use virtual column, created with Hive-style partitioning ``` sql -SET use_hive_partitioning = 1; SELECT * from s3('s3://data/path/date=*/country=*/code=*/*.parquet') where _date > '2020-01-01' and _country = 'Netherlands' and _code = 42; ``` diff --git a/docs/en/sql-reference/table-functions/url.md b/docs/en/sql-reference/table-functions/url.md index 7a354ea03646..129863cccac0 100644 --- a/docs/en/sql-reference/table-functions/url.md +++ b/docs/en/sql-reference/table-functions/url.md @@ -65,7 +65,6 @@ When setting `use_hive_partitioning` is set to 1, ClickHouse will detect Hive-st Use virtual column, created with Hive-style partitioning ``` sql -SET use_hive_partitioning = 1; SELECT * from url('http://data/path/date=*/country=*/code=*/*.parquet') where _date > '2020-01-01' and _country = 'Netherlands' and _code = 42; ``` diff --git a/src/Core/Settings.cpp b/src/Core/Settings.cpp index 0b4bd1af28cf..d04b9bcf2a71 100644 --- a/src/Core/Settings.cpp +++ b/src/Core/Settings.cpp @@ -5856,7 +5856,7 @@ The maximum number of rows in the right table to determine whether to rerange th DECLARE(Bool, allow_experimental_join_right_table_sorting, false, R"( If it is set to true, and the conditions of `join_to_sort_minimum_perkey_rows` and `join_to_sort_maximum_table_rows` are met, rerange the right table by key to improve the performance in left or inner hash join. )", EXPERIMENTAL) \ - DECLARE(Bool, use_hive_partitioning, false, R"( + DECLARE(Bool, use_hive_partitioning, true, R"( When enabled, ClickHouse will detect Hive-style partitioning in path (`/name=value/`) in file-like table engines [File](../../engines/table-engines/special/file.md#hive-style-partitioning)/[S3](../../engines/table-engines/integrations/s3.md#hive-style-partitioning)/[URL](../../engines/table-engines/special/url.md#hive-style-partitioning)/[HDFS](../../engines/table-engines/integrations/hdfs.md#hive-style-partitioning)/[AzureBlobStorage](../../engines/table-engines/integrations/azureBlobStorage.md#hive-style-partitioning) and will allow to use partition columns as virtual columns in the query. These virtual columns will have the same names as in the partitioned path, but starting with `_`. )", EXPERIMENTAL)\ \ diff --git a/src/Core/SettingsChangesHistory.cpp b/src/Core/SettingsChangesHistory.cpp index 1ec6ac0090e0..310d8c1c3e56 100644 --- a/src/Core/SettingsChangesHistory.cpp +++ b/src/Core/SettingsChangesHistory.cpp @@ -79,6 +79,7 @@ static std::initializer_list