Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/connectors/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,16 @@ pub enum Error {
/// failures so that circuit breakers are not tripped by bad data.
#[error("Permanent HTTP error: {0}")]
PermanentHttpError(String),
/// The source schema could not be mapped to the destination schema.
/// Indicates a table definition or configuration problem
#[error("Schema mismatch: {0}")]
SchemaMismatch(String),
/// An I/O failure while writing data (e.g. Parquet serialization, file
/// writer close). Distinct from record-level validation errors.
#[error("Write failure: {0}")]
WriteFailure(String),
/// A catalog or transaction-level failure (e.g. applying or committing an
/// Iceberg transaction). Callers may retry on transient catalog outages.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

doc "callers may retry on transient catalog outages" is misleading. action.apply() at router/mod.rs:213 is in-memory transaction prep - deterministic failures (invalid partition spec, schema validation) cannot be retried. only tx.commit(catalog) at router/mod.rs:222 hits the network. suggest dropping the retry claim, or splitting into ApplyError (deterministic) vs CommitError (transient-eligible).

#[error("Catalog error: {0}")]
CatalogError(String),
}
10 changes: 5 additions & 5 deletions core/connectors/sinks/iceberg_sink/src/router/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async fn write_data(
table.metadata().uuid(),
err
);
Error::InvalidRecord
Error::SchemaMismatch(err.to_string())
})?,
))
.build(cursor)
Expand All @@ -197,13 +197,13 @@ async fn write_data(
})?;
writer.write(batch_data).await.map_err(|err| {
error!("Error while writing record batch: {}", err);
Error::InvalidRecord
Error::WriteFailure(err.to_string())
})?;
}

let data_files = writer.close().await.map_err(|err| {
error!("Error while writing data records to Parquet file: {}", err);
Error::InvalidRecord
Error::WriteFailure(err.to_string())
})?;

let table_commit = Transaction::new(table);
Expand All @@ -216,7 +216,7 @@ async fn write_data(
table.metadata().uuid(),
err
);
Error::InvalidRecord
Error::CatalogError(err.to_string())
})?;

let _table = tx.commit(catalog).await.map_err(|err| {
Expand All @@ -225,7 +225,7 @@ async fn write_data(
table.metadata().uuid(),
err
);
Error::InvalidRecord
Error::CatalogError(err.to_string())
})?;
Ok(())
}
Expand Down
Loading