osipovartem commented on issue #16001:
URL: https://github.com/apache/datafusion/issues/16001#issuecomment-2866169342
We cannot pass DF SanityCheck since FileScanConfig implements DataSource
trait with
```rust
impl DataSource for FileScanConfig {
.....
fn output_partitioning(&self) -> Partitioning {
Partitioning::UnknownPartitioning(self.file_groups.len())
}
```
Because of that we have UnknownPartitioning(0) (as we don't have any files,
just empty table)
But SortExec creates by default UnknownPartitioning(1)
Here is the full execution plan for the select query above
```
SortExec {
input: DataSourceExec {
data_source: FileScanConfig {object_store_url=ObjectStoreUrl { url:
Url { scheme: "file", cannot_be_a_base: false, username: "", password: None,
host: None, port: None, path: "/", query: None, fragment: None } },
statistics=Statistics { num_rows: Exact(0), total_byte_size: Exact(0),
column_statistics: [ColumnStatistics { null_count: Absent, max_value: Absent,
min_value: Absent, sum_value: Absent, distinct_count: Absent }] },
file_groups={0 groups: []}, projection=[app_id]},
cache: PlanProperties {
eq_properties: EquivalenceProperties {
eq_group: EquivalenceGroup {
classes: [],
},
oeq_class: OrderingEquivalenceClass {
orderings: [],
},
constants: [],
constraints: Constraints {
inner: [],
},
schema: Schema {
fields: [
Field {
name: "app_id",
data_type: Int32,
nullable: true,
dict_id: 0,
dict_is_ordered: false,
metadata: {
"PARQUET:field_id": "1",
},
},
],
metadata: {},
},
},
partitioning: UnknownPartitioning(
0,
),
emission_type: Incremental,
boundedness: Bounded,
output_ordering: None,
},
},
expr: LexOrdering {
inner: [
PhysicalSortExpr {
expr: Column {
name: "app_id",
index: 0,
},
options: SortOptions {
descending: false,
nulls_first: false,
},
},
],
},
metrics_set: ExecutionPlanMetricsSet {
inner: Mutex {
data: MetricsSet {
metrics: [],
},
},
},
preserve_partitioning: false,
fetch: None,
common_sort_prefix: LexOrdering {
inner: [],
},
cache: PlanProperties {
eq_properties: EquivalenceProperties {
eq_group: EquivalenceGroup {
classes: [],
},
oeq_class: OrderingEquivalenceClass {
orderings: [
LexOrdering {
inner: [
PhysicalSortExpr {
expr: Column {
name: "app_id",
index: 0,
},
options: SortOptions {
descending: false,
nulls_first: false,
},
},
],
},
],
},
constants: [],
constraints: Constraints {
inner: [],
},
schema: Schema {
fields: [
Field {
name: "app_id",
data_type: Int32,
nullable: true,
dict_id: 0,
dict_is_ordered: false,
metadata: {
"PARQUET:field_id": "1",
},
},
],
metadata: {},
},
},
partitioning: **UnknownPartitioning(
1,
)**,
emission_type: Final,
boundedness: Bounded,
output_ordering: Some(
LexOrdering {
inner: [
PhysicalSortExpr {
expr: Column {
name: "app_id",
index: 0,
},
options: SortOptions {
descending: false,
nulls_first: false,
},
},
],
},
),
},
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]