Skip to content

Commit 576dd12

Browse files
committed
[adapters] Use table-level skip_unused_columns property.
The Delta connector `skip_unused_columns` attribute introduces unhealthy coupling between connector and table definitions, where the table definition can implicitly change when a connector is added, removed, or modified. We make skip_unused_columns a table-level property instead. It advises connectors that they don't have to ingest unused columns if they support this optimization. We partially keep backward compatibility by computing `skip_unused_columns` as a logical OR of per-connector and per-table attributes: * Existing tables that don't have Delta connectors with `skip_unused_columns` set to true are not affected. * Existing tables that have Delta connectors with `skip_unudes_columns` will behave as if the table definition has changed when the program is recompiled with the new runtime version. These tables will be backfilled from scratch. Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
1 parent dfed895 commit 576dd12

5 files changed

Lines changed: 24 additions & 6 deletions

File tree

crates/adapters/src/integrated/delta_table/input.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,13 @@ impl DeltaTableInputEndpointInner {
519519
}
520520
}
521521

522+
fn skip_unused_columns(&self) -> bool {
523+
// Old-style: property in the connector configuration.
524+
// New-style: property in the table definition.
525+
self.config.skip_unused_columns
526+
|| self.schema.get_property("skip_unused_columns") == Some("true")
527+
}
528+
522529
fn allocate_follow_transaction_label(&self) -> Option<Option<String>> {
523530
if self.config.transaction_mode == DeltaTableTransactionMode::Always {
524531
Some(Some(format!(
@@ -604,7 +611,7 @@ impl DeltaTableInputEndpointInner {
604611
/// table declaration.
605612
fn used_columns(&self, table: &DeltaTable) -> Vec<String> {
606613
// Column names in the SQL schema.
607-
let sql_columns = if self.config.skip_unused_columns {
614+
let sql_columns = if self.skip_unused_columns() {
608615
self.schema
609616
.fields
610617
.iter()

crates/feldera-types/src/program_schema.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ impl Relation {
238238
pub fn has_lateness(&self) -> bool {
239239
self.fields.iter().any(|f| f.lateness.is_some())
240240
}
241+
242+
pub fn get_property(&self, name: &str) -> Option<&str> {
243+
self.properties.get(name).map(|p| p.value.as_str())
244+
}
241245
}
242246

243247
/// A SQL field.

docs.feldera.com/docs/changelog.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import TabItem from '@theme/TabItem';
1515

1616
## Unreleased
1717

18-
Prometheus metrics output now also contains pipeline names with a
19-
"pipeline_name" label, in addition to the exist "pipeline" label,
20-
which still contains the pipeline UUID.
18+
The Delta Lake connector's `skip_unused_columns` property has been deprecated. Use
19+
table-level [`skip_unused_colums`](https://docs.feldera.com/sql/grammar#skip-unused-columns)
20+
instead.
2121

2222
## 0.201.0
2323

@@ -36,7 +36,13 @@ import TabItem from '@theme/TabItem';
3636
for the monitoring, is configured with an additional RBAC permission needed for this
3737
feature (see `kubernetes-runner-rbac.yaml` for changes).
3838

39-
## 0.186.00
39+
## 0.188.0
40+
41+
Prometheus metrics output now also contains pipeline names with a
42+
"pipeline_name" label, in addition to the exist "pipeline" label,
43+
which still contains the pipeline UUID.
44+
45+
## 0.186.0
4046

4147
The Kafka input connector will now start reading partitions added
4248
to a topic upon resuming from a checkpoint. Previously, the

docs.feldera.com/docs/connectors/sources/delta.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ exactly once fault tolerance.
3636
| `cdc_delete_filer` | string | | <p>A predicate that determines whether the record represents a deletion.</p><p>This setting is only valid in the `cdc` mode. It specifies a predicate applied to each row in the Delta table to determine whether the row represents a deletion event. Its value must be a valid Boolean SQL expression that can be used in a query of the form `SELECT * from <table> WHERE <cdc_delete_filter>`.</p>|
3737
| `cdc_order_by` | string | | <p>An expression that determines the ordering of updates in the Delta table.</p><p>This setting is only valid in the `cdc` mode. It specifies a predicate applied to each row in the Delta table to determine the order in which updates in the table should be applied. Its value must be a valid SQL expression that can be used in a query of the form `SELECT * from <table> ORDER BY <cdc_order_by>`.</p>|
3838
| `num_parsers` | string | | The number of parallel parsing tasks the connector uses to process data read from the table. Increasing this value can enhance performance by allowing more concurrent processing. Recommended range: 1–10. The default is 4.|
39-
| `skip_unused_columns` | bool | false | <b>Deprecated</b>, use the per-table property. <p>Don't read unused columns from the Delta table. When set to `true`, this option instructs the connector to avoid reading columns from the Delta table that are not used in any view definitions. To be skipped, the columns must be either nullable or have default values. This can improve ingestion performance, especially for wide tables.</p><p>Note: The simplest way to exclude unused columns is to omit them from the Feldera SQL table declaration. The connector never reads columns that aren't declared in the SQL schema. Additionally, the SQL compiler emits warnings for declared but unused columns—use these as a guide to optimize your schema.</p>|
39+
| `skip_unused_columns` (<b>DEPRECATED</b>) | bool | false | <p>This property is deprecated. Use the [table-level `skip_unused_columns` property](/sql/grammar#skip-unused-columns) instead.</p><p>Don't read unused columns from the Delta table. When set to `true`, this option instructs the connector to avoid reading columns from the Delta table that are not used in any view definitions. To be skipped, the columns must be either nullable or have default values. This can improve ingestion performance, especially for wide tables.</p><p>Note: The simplest way to exclude unused columns is to omit them from the Feldera SQL table declaration. The connector never reads columns that aren't declared in the SQL schema. Additionally, the SQL compiler emits warnings for declared but unused columns—use these as a guide to optimize your schema.</p>|
4040
| `max_concurrent_readers` | integer| 6 | <p>Maximum number of concurrent object store reads performed by all Delta Lake connectors.</p><p>This setting is used to limit the number of concurrent reads of the object store in a pipeline with a large number of Delta Lake connectors. When multiple connectors are simultaneously reading from the object store, this can lead to transport timeouts.</p><p>When enabled, this setting limits the number of concurrent reads across all connectors. This is a global setting that affects all Delta Lake connectors, and not just the connector where it is specified. It should therefore be used at most once in a pipeline. If multiple connectors specify this setting, they must all use the same value.</p><p>The default value is 6.</p>|
4141

4242
[*]: Required fields

docs.feldera.com/docs/sql/grammar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ The property `expected_size` can be used to pass information to the
207207
SQL compiler about the expected size of a table in steady state
208208
operation. The value of this property should be an integer value.
209209

210+
<a id="skip-unused-columns"></a>
210211
#### Ignoring unused columns
211212

212213
The `skip_unused_columns` is an optional Boolean property that can be

0 commit comments

Comments
 (0)