cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot connect to Databricks SQL Endpoint using PHP and ODBC

Rex
New Contributor III

I am trying to connect to our Databricks SQL endpoint using PHP in a Docker container.

I setup my Docker container to download and configure the ODBC driver as specified here: https://docs.databricks.com/integrations/bi/jdbc-odbc-bi.html#install-and-configure-the-odbc-driver-...

My Docker setup is at https://github.com/rlorenzo/databricks_php

However, when it try to connect using ODBC from my PHP test script I get the error:

Warning: odbc_connect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect in /test_connection.php on line 14
ODBC connect failed: S1000

The connection details are correct because I was able to connect to the Databricks SQL endpoint using Datagrip. I can also verify that the ODBC library is properly installed because I can query a Microsoft SQL Server.

I must have the Databricks ODBC Connector misconfigured somehow, but I am clueless. In my view, everything matches the documentation.

I did try using the Databricks driver in my odbc.ini file:

Driver=/opt/simba/spark/lib/64/libsparkodbc_sb64.so

But I get the error Can't open lib '/opt/simba/spark/lib/64/libsparkodbc_sb64.so' : file not found

However, the file does exist:

ls /opt/simba/spark/lib/64/libsparkodbc_sb64.so
-rwxrwxrwx 1 root root 76265161 Oct 26 20:51 /opt/simba/spark/lib/64/libsparkodbc_sb64.so

Anything else I should try?

I also asked this on StackOverflow: https://stackoverflow.com/questions/71271023/cannot-connect-to-databricks-sql-endpoint-using-php-and...

1 ACCEPTED SOLUTION

Accepted Solutions

@Rex Lorenzo​  the driver is not yet open source (it's definitely something we're looking at). I've chatted to the team that builds drivers, getting an Arm build out is definitely on their roadmap. Unfortunately, I can't give an exact date just yet.

View solution in original post

7 REPLIES 7

Rex
New Contributor III

The problem was that the Databricks SQL driver does not yet support ARM, which my laptop and Docker container was building for. See ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/simba/spark/lib/64/libsparkodbc_sb...

I updated my repo at https://github.com/rlorenzo/databricks_php with a working example and forced the container to build an x86 version.

Will update my repo if Databricks ever supports ARM.

Hope this helps someone in the future.

BilalAslamDbrx
Honored Contributor II
Honored Contributor II

Thanks for investigating, @Rex Lorenzo​ . You are indeed correct, we do not currently have an ARM build.

Rex
New Contributor III

@Bilal Aslam​  Any plans to offer an ARM build? Or can we get access to the source so we can build one?

Atanu
Esteemed Contributor
Esteemed Contributor

Also - I think we should have this as a feature request for the same . @Rex Lorenzo​  could you please add a feature request from https://docs.databricks.com/resources/ideas.html .

Let me know if you are able to else I will get this added to our internal system

Rex
New Contributor III

@Atanu Sarkar​ I posted the feature request here https://ideas.databricks.com/ideas/DBE-I-735

Atanu
Esteemed Contributor
Esteemed Contributor

Thanks you so much @Rex Lorenzo​ !

@Rex Lorenzo​  the driver is not yet open source (it's definitely something we're looking at). I've chatted to the team that builds drivers, getting an Arm build out is definitely on their roadmap. Unfortunately, I can't give an exact date just yet.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.