davlee1972 commented on issue #1422:
URL: https://github.com/apache/arrow-adbc/issues/1422#issuecomment-1896317957

   This could be an issue with the go driver or handled in adbc.. Here's the 
equivalent snowflake python connector code..
   
   
https://github.com/snowflakedb/snowflake-connector-python/blob/main/src/snowflake/connector/util_text.py
   
   ** host in my case needs to be passed in with account = 
my_account.privatelink" **
   host = f"{account}.snowflakecomputing.com"
   
   ** the parsed_account turns my_account.privatelink to just my_account which 
essentially strips ".privatelink" **
   url_parts = account.split(".")
   parsed_account = url_parts[0]
   
   ```
   def construct_hostname(region: str | None, account: str) -> str:
       """Constructs hostname from region and account."""
       if region == "us-west-2":
           region = ""
       if region:
           if account.find(".") > 0:
               account = account[0 : account.find(".")]
           host = f"{account}.{region}.snowflakecomputing.com"
       else:
           host = f"{account}.snowflakecomputing.com"
       return host
   
   
   def parse_account(account):
       url_parts = account.split(".")
       # if this condition is true, then we have some extra
       # stuff in the account field.
       if len(url_parts) > 1:
           if url_parts[1] == "global":
               # remove external ID from account
               parsed_account = url_parts[0][0 : url_parts[0].rfind("-")]
           else:
               # remove region subdomain
               parsed_account = url_parts[0]
       else:
           parsed_account = account
   
       return parsed_account
   ```
   


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