File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,14 @@ public actor Catalog: Sendable {
197197 /// - Parameter dbName: name of the database to check existence
198198 /// - Returns: Indicating whether the database exists.
199199 public func databaseExists( _ dbName: String ) async throws -> Bool {
200- return try await self . listDatabases ( pattern: dbName) . count > 0
200+ let df = getDataFrame ( {
201+ var databaseExists = Spark_Connect_DatabaseExists ( )
202+ databaseExists. dbName = dbName
203+ var catalog = Spark_Connect_Catalog ( )
204+ catalog. catType = . databaseExists( databaseExists)
205+ return catalog
206+ } )
207+ return try await df. collect ( ) . first![ 0 ] as! Bool
201208 }
202209
203210 /// Creates a table from the given path and returns the corresponding ``DataFrame``.
You can’t perform that action at this time.
0 commit comments