gratus00 commented on code in PR #27644:
URL: https://github.com/apache/datafusion/pull/27644#discussion_r4763066046
##########
docs/source/library-user-guide/upgrading/57.0.0.md:
##########
@@ -372,3 +372,55 @@ simplify expressions such as `col IS NULL` on them.
Row values are unchanged, but schema inspection can differ: code that compares
the resulting schema against a hand-written one with `nullable: true` for
every field needs to be updated.
+
+### `CatalogProvider` and `SchemaProvider` lookup methods now return `Result`
+
+The following methods could not report errors, so implementations backed by a
+remote catalog had to return an empty list, `None`, or `false` when a request
+failed. That was indistinguishable from "no schemas", "schema not found", or
+"table not found". They now return `Result`:
+
+| Trait | Method | 56.0.0 |
57.0.0 |
+| ----------------- | ---------------- | --------------------------------- |
----------------------------------------- |
+| `CatalogProvider` | `schema_names()` | `Vec<String>` |
`Result<Vec<String>>` |
+| `CatalogProvider` | `schema()` | `Option<Arc<dyn SchemaProvider>>` |
`Result<Option<Arc<dyn SchemaProvider>>>` |
+| `SchemaProvider` | `table_names()` | `Vec<String>` |
`Result<Vec<String>>` |
+| `SchemaProvider` | `table_exist()` | `bool` |
`Result<bool>` |
+
+Implementations that cannot fail can wrap their existing return value in `Ok`:
+
+```rust
+// 56.0.0
+fn table_exist(&self, name: &str) -> bool {
+ self.tables.contains_key(name)
+}
+
+// 57.0.0
+fn table_exist(&self, name: &str) -> Result<bool> {
+ Ok(self.tables.contains_key(name))
+}
+```
+
+Callers need to handle the error, typically with `?`:
+
+```rust
+// 56.0.0
+if let Some(schema) = catalog.schema("public") {
+ for table in schema.table_names() { /* ... */ }
+}
+
+// 57.0.0
+if let Some(schema) = catalog.schema("public")? {
+ for table in schema.table_names()? { /* ... */ }
+}
+```
+
+The FFI wrappers (`FFI_CatalogProvider` and `FFI_SchemaProvider`) carry these
+errors across the FFI boundary instead of dropping them.
+
+**This breaks `datafusion-ffi` ABI compatibility.** The `schema_names`,
Review Comment:
Hmm I see. Should I wait until your adjustment is merged before merging this
change? Or remove my comment related to ABI after your PR lands?
--
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]