Skip to content

Commit e91397a

Browse files
author
Héctor Veiga Ortiz
committed
change prefix to execution. , update override order for condition.
1 parent 89adc88 commit e91397a

File tree

6 files changed

+18
-25
lines changed

6 files changed

+18
-25
lines changed

datafusion/common/src/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,7 @@ impl TableOptions {
12851285
return ConfigField::set(self, key, value);
12861286
}
12871287

1288-
// Only used for hive.keep_partition_by_columns
1289-
if prefix == "hive" {
1288+
if prefix == "execution" {
12901289
return Ok(());
12911290
}
12921291

datafusion/core/src/physical_planner.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -778,14 +778,15 @@ impl DefaultPhysicalPlanner {
778778
.collect::<Vec<_>>();
779779

780780
let keep_partition_by_columns = source_option_tuples
781-
.get("hive.keep_partition_by_columns")
781+
.get("execution.keep_partition_by_columns")
782782
.map(|v| v.trim() == "true")
783-
.unwrap_or(false)
784-
|| session_state
785-
.config()
786-
.options()
787-
.execution
788-
.keep_partition_by_columns;
783+
.unwrap_or(
784+
session_state
785+
.config()
786+
.options()
787+
.execution
788+
.keep_partition_by_columns,
789+
);
789790

790791
// Set file sink related options
791792
let config = FileSinkConfig {

datafusion/sql/src/statement.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -889,14 +889,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
889889
Some(v) => v,
890890
};
891891

892-
if key.to_lowercase().contains("keep_partition_by_columns") {
893-
let renamed_key = if !&key.starts_with("hive.") {
894-
format!("hive.{}", key)
895-
} else {
896-
key
897-
};
898-
options.insert(renamed_key.to_lowercase(), value_string.to_lowercase());
899-
} else if !(&key.contains('.')) {
892+
if !(&key.contains('.')) {
900893
// If config does not belong to any namespace, assume it is
901894
// a format option and apply the format prefix for backwards
902895
// compatibility.

datafusion/sqllogictest/test_files/copy.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ physical_plan
169169
# Copy to directory as partitioned files with keep_partition_by_columns enabled
170170
query TT
171171
COPY (values ('1', 'a'), ('2', 'b'), ('3', 'c')) TO 'test_files/scratch/copy/partitioned_table4/' STORED AS parquet PARTITIONED BY (column1)
172-
OPTIONS (KEEP_PARTITION_BY_COLUMNS true);
172+
OPTIONS (execution.keep_partition_by_columns true);
173173
----
174174
3
175175

docs/source/user-guide/sql/dml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ clause is not specified, it will be inferred from the file extension if possible
4141
`PARTITIONED BY` specifies the columns to use for partitioning the output files into
4242
separate hive-style directories. By default, columns used in `PARTITIONED BY` will be removed
4343
from the output format. If you want to keep the columns, you should provide the option
44-
`KEEP_PARTITION_BY_COLUMNS true`. `KEEP_PARTITION_BY_COLUMNS` flag can also be enabled
45-
through `ExecutionOptions` within `SessionConfig`.
44+
`execution.keep_partition_by_columns true`. `execution.keep_partition_by_columns` flag can also
45+
be enabled through `ExecutionOptions` within `SessionConfig`.
4646

4747
The output format is determined by the first match of the following rules:
4848

docs/source/user-guide/sql/write_options.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ In this example, we write the entirety of `source_table` out to a folder of parq
7070

7171
## Available Options
7272

73-
### Hive Specific Options
73+
### Execution Specific Options
7474

7575
The following options are available when writing hive-style partitioned data.
7676

77-
| Option | Description | Default Value |
78-
| ------------------------- | ---------------------------------------------------------------------------------- | ------------- |
79-
| KEEP_PARTITION_BY_COLUMNS | Flag to retain the columns in the output data when using `PARTITIONED BY` queries. | false |
77+
| Option | Description | Default Value |
78+
|-------------------------------------| ---------------------------------------------------------------------------------- | ------------- |
79+
| execution.keep_partition_by_columns | Flag to retain the columns in the output data when using `PARTITIONED BY` queries. | false |
8080

81-
Note: `KEEP_PARTITION_BY_COLUMNS` flag can also be enabled through `ExecutionOptions` within `SessionConfig`.
81+
Note: `execution.keep_partition_by_columns` flag can also be enabled through `ExecutionOptions` within `SessionConfig`.
8282

8383
### JSON Format Specific Options
8484

0 commit comments

Comments
 (0)