eric-wang-1990 commented on code in PR #2896:
URL: https://github.com/apache/arrow-adbc/pull/2896#discussion_r2122273174


##########
csharp/src/Drivers/Databricks/DatabricksConnection.cs:
##########
@@ -374,6 +370,31 @@ protected override TOpenSessionReq CreateSessionRequest()
             return req;
         }
 
+
+        protected override async Task 
HandleOpenSessionResponse(TOpenSessionResp? session)
+        {
+            await base.HandleOpenSessionResponse(session);
+            if (session != null)
+            {
+                _enableMultipleCatalogSupport = 
session.__isset.canUseMultipleCatalogs ? session.CanUseMultipleCatalogs : false;
+                if (session.__isset.initialNamespace)
+                {
+                    _defaultNamespace = session.InitialNamespace;
+                }
+                else if (_defaultNamespace != null && 
!string.IsNullOrEmpty(_defaultNamespace.SchemaName))

Review Comment:
   Let's add some more comments around this else clause, basically this only 
happens for when there is no initialNamespace response, which means it's an old 
DBR + Also user pass in a default schema name.
   We are not doing it for catalog since multipleCatalog is needed for 
specifying catalogs, and that is the same protocol version with which we 
support for initialNamespace, which means if the response does not contain 
initialNamespace means we do not support specifying catalog at all.



##########
csharp/src/Drivers/Databricks/DatabricksConnection.cs:
##########
@@ -168,18 +168,14 @@ private void ValidateProperties()
             Properties.TryGetValue(AdbcOptions.Connection.CurrentCatalog, out 
defaultCatalog);
             Properties.TryGetValue(AdbcOptions.Connection.CurrentDbSchema, out 
defaultSchema);
 
-            if (!string.IsNullOrWhiteSpace(defaultCatalog))
+            if (!string.IsNullOrWhiteSpace(defaultCatalog) || 
!string.IsNullOrWhiteSpace(defaultSchema))
             {
                 _defaultNamespace = new TNamespace
                 {
                     CatalogName = defaultCatalog,

Review Comment:
   Should we only set ifcatalog/schema is not null?



-- 
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]

Reply via email to