eric-wang-1990 commented on code in PR #2896:
URL: https://github.com/apache/arrow-adbc/pull/2896#discussion_r2122403046
##########
csharp/src/Drivers/Databricks/DatabricksConnection.cs:
##########
@@ -374,6 +370,27 @@ protected override TOpenSessionReq CreateSessionRequest()
return req;
}
+
+ protected override async Task
HandleOpenSessionResponse(TOpenSessionResp? session)
+ {
+ await base.HandleOpenSessionResponse(session);
+ if (session != null)
+ {
+ if (session.__isset.initialNamespace) {
+ _defaultNamespace = session.InitialNamespace;
+ } else if (_defaultNamespace != null &&
!string.IsNullOrEmpty(_defaultNamespace.SchemaName)) {
+ // server version is too old. Explicitly set the schema
using queries
+ await SetSchema(_defaultNamespace.SchemaName);
+ }
+ }
+ }
+
+ private async Task SetSchema(string schemaName) {
+ using var statement = new DatabricksStatement(this);
+ statement.SqlQuery = $"USE {schemaName}";
Review Comment:
@toddmeng-db Let's make another ticket to handle the escape, all the
metadata call does not escape now but should be doing that.
@CurtHagenlocher Regarding whether there is a current catalog, this will
only be called on legacy DBR where there is no catalog concept, in such
scenarios we should be able to just call use schema.
--
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]