dongjoon-hyun opened a new pull request, #589: URL: https://github.com/apache/spark-connect-swift/pull/589
### What changes were proposed in this pull request? This PR aims to fix `Catalog.listDatabases`, `Catalog.getDatabase`, and `Catalog.getFunction` to handle nullable `locationUri` and `className` columns gracefully by falling back to an empty string, like `Catalog.listFunctions` already does. ### Why are the changes needed? Previously, these APIs force-cast the `locationUri` and `className` columns with `as! String`, which crashes the client process when the server returns `null`. - Apache Spark returns `locationUri = null` for V2 catalog namespaces without a location property (e.g., `JDBCTableCatalog`). - Apache Spark returns `className = null` for virtual operators such as `case`, `<>`, `!=`, and `||`. ``` Could not cast value of type 'Swift.Optional<Any>' to 'Swift.String'. ``` ### Does this PR introduce _any_ user-facing change? Yes. These APIs now return an empty string instead of crashing. There is no API change because `Database.locationUri` and `Function.className` remain `String`. ### How was this patch tested? Pass the CIs with the newly added test cases. I also verified them manually against an Apache Spark 4.2.0 Connect server. ``` $ swift test --no-parallel --filter CatalogTests ... Test run with 41 tests in 1 suite passed ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 -- 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]
