Skip to content

Use arrow as intermediate type representation#797

Draft
bnjjj wants to merge 4 commits into
mainfrom
bnjjj/arrow_migration
Draft

Use arrow as intermediate type representation#797
bnjjj wants to merge 4 commits into
mainfrom
bnjjj/arrow_migration

Conversation

@bnjjj

@bnjjj bnjjj commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The main goal is to get rid of TableRow and Cell to only use arrow types and benefit from arrow allocations and compliant destinations with arrow

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a bad merge conflict

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, probably merge conflict issue

Ok(())
}

#[allow(dead_code)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge conflict issue ?

/// Converts destination-facing Arrow CDC batches back to DuckLake row
/// events.
async fn stream_batches_to_events(&self, batches: Vec<StreamBatch>) -> EtlResult<Vec<Event>> {
let mut events = Vec::new();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can set a default capacity here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need to have pub structs and so one now ?

Comment on lines -162 to -166
/// Shutdown requested.
///
/// No new WAL is accepted, but buffered or in-flight destination work is
/// still allowed to drain.
DrainingForShutdown,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suspicious...

/// Cleanup is considered only after status updates, because those are natural
/// progress points where durable ETL progress may have advanced. The next
/// deadline is scheduled when the previous cleanup task finishes.
const SCHEMA_CLEANUP_INTERVAL: Duration = Duration::from_hours(1);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suspicious

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Comment thread crates/etl/src/replication/stream.rs Outdated
Comment on lines +83 to +100
counter!(ETL_BYTES_PROCESSED_TOTAL, EVENT_TYPE_LABEL => "copy")
.increment(row_size_bytes);
counter!(
ETL_BYTES_PROCESSED_TOTAL,
PIPELINE_ID_LABEL => this.pipeline_id.to_string(),
EVENT_TYPE_LABEL => "copy"
)
.increment(row_size_bytes);

histogram!(ETL_ROW_SIZE_BYTES, EVENT_TYPE_LABEL => "copy")
.record(row_size_bytes as f64);
histogram!(
ETL_ROW_SIZE_BYTES,
PIPELINE_ID_LABEL => this.pipeline_id.to_string(),
EVENT_TYPE_LABEL => "copy"
)
.record(row_size_bytes as f64);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required because #652

Comment on lines -200 to +209
replicated_table_schema: ReplicatedTableSchema,
table_schema: Arc<TableSchema>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm suspicious about this.

histogram!(ETL_PARALLEL_TABLE_COPY_TIME_IMBALANCE).record(time_lif);
histogram!(
ETL_PARALLEL_TABLE_COPY_TIME_IMBALANCE,
PIPELINE_ID_LABEL => pipeline_id.to_string(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be required here because we add it before as a global label when starting replicator

histogram!(ETL_PARALLEL_TABLE_COPY_ROWS_IMBALANCE).record(rows_lif);
histogram!(
ETL_PARALLEL_TABLE_COPY_ROWS_IMBALANCE,
PIPELINE_ID_LABEL => pipeline_id.to_string(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be required here because we add it before as a global label when starting replicator


histogram!(
ETL_TABLE_COPY_ROWS,
PIPELINE_ID_LABEL => pipeline_id.to_string(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

histogram!(
ETL_TABLE_COPY_ROWS,
PIPELINE_ID_LABEL => pipeline_id.to_string(),
DESTINATION_LABEL => D::name(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should do the same for destination if it's not already done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(using global label)

Comment thread crates/etl/tests/pipeline.rs Outdated

// Serialized via nextest test-group "shared-pg" (shares the source PG cluster).
#[tokio::test(flavor = "multi_thread")]
#[ignore = "modifies cluster-wide PG settings; run independently with: cargo test -- --ignored \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

Comment thread crates/etl/tests/pipeline.rs Outdated

// Serialized via nextest test-group "shared-pg" (shares the source PG cluster).
#[tokio::test(flavor = "multi_thread")]
#[ignore = "modifies cluster-wide PG settings; run independently with: cargo test -- --ignored \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

/// 4. Insert 3 new rows (ids 100-102) for users only
/// 5. Verify: users has 10 total rows (table_rows + events), orders unchanged
#[tokio::test(flavor = "multi_thread")]
async fn table_sync_drops_destination_table_after_state_reset() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing it ?

@bnjjj bnjjj left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not remove tests if this is not for removed code

bnjjj added 2 commits June 2, 2026 15:40
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant