3 weeks ago
Hi ,
I am getting this Error:
WHERE 1=0, Error message from Server: Configuration db table is not available. I am using PySpark and JDBC connection. Please help on this.
3 weeks ago
Hi @pritam_epam ,
Could you share with us more details like code that you want to execute etc.?
3 weeks ago
com.databricks.client.support.exceptions.GeneralException: [Databricks][JDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: null, Query: SELECT * FROM (select * from scna_qa.dsml.geonode_sku_dategrp_kpi) SPARK_GEN_SUBQ_0 WHERE 1=0, Error message from Server: Configuration query is not available..
3 weeks ago - last edited 3 weeks ago
Below you're passing query variable to read_sql_query function but I don't see any place in your code where you defined this.
table = (spark.read
.format("jdbc")
.option("url", "<jdbc-url>")
.option("dbtable", "<table-name>")
.option("user", "<username>")
.option("password", "<password>")
.load()
)
Query databases using JDBC - Azure Databricks | Microsoft Learn
Query databases using JDBC - Azure Databricks | Microsoft Learn
3 weeks ago
This is the query I already defined -
3 weeks ago
@szymon_dybczak I also tried the another approach you provided,
3 weeks ago - last edited 3 weeks ago
Hi @pritam_epam ,
Try something similar to the following code and see if to works for you.
databricks_url = f'''jdbc:databricks://adb-774941343460743.3.azuredatabricks.net:443/default;
transportMode=http;
ssl=1;
httpPath=sql/protocolv1/o/your_org_id/your_cluster_id;
AuthMech=3;
UID=token;
PWD=your_accesss_token;
UseNativeQuery=0;
'''
df = spark.read.format("jdbc").option("url", databricks_url) \
.option("query", 'SELECT * FROM main.default.department') \
.load()
display(df)
In my case it worked without any issue:
3 weeks ago
No it's again throwing same type of exceptions
[Databricks][JDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: null, Query: SELECT * FROM (SELECT * FROM scna_qa.dsml.geonode_sku_dategrp_kpi) SPARK_GEN_SUBQ_0 WHERE 1=0, Error message from Server: Configuration query is not available..
3 weeks ago
can we do a meeting to understand what's the issue?
3 weeks ago
Can you help us on this? Or could you provide a complete structure/steps how to connect with databricks using PySpark and JDBC step by step . Like initiate spark session then JDBC connection url then sql read all these in details.
Also what should be the JDBC version ? I am using databricks==0.2 and JDBC - DatabricksJDBC42.jar latest, what is the compatible JDBC driver?
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group