You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/10/07 22:18:50 UTC

[PR] [SPARK-60063] Fix Catalog.listDatabases/getDatabase/getFunction to not crash on null locationUri and className [spark-connect-swift]

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-60063] Fix Catalog.listDatabases/getDatabase/getFunction to not crash on null locationUri and className [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #589:
URL: https://github.com/apache/spark-connect-swift/pull/589#issuecomment-6048772400

   Merged to main


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-60063] Fix Catalog.listDatabases/getDatabase/getFunction to not crash on null locationUri and className [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #589:
URL: https://github.com/apache/spark-connect-swift/pull/589#issuecomment-6048767087

   Thank you, @viirya . 😄 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-60063] Fix Catalog.listDatabases/getDatabase/getFunction to not crash on null locationUri and className [spark-connect-swift]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #589: [SPARK-60063] Fix Catalog.listDatabases/getDatabase/getFunction to not crash on null locationUri and className
URL: https://github.com/apache/spark-connect-swift/pull/589


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org