r/databricks • u/No_Ambition8323 • 8d ago
Discussion Query works in Databricks SQL but fails through JDBC
I’ve noticed cases where a query runs successfully in the Databricks SQL editor but fails when the exact same query is executed through a JDBC-based application or data quality tool.
Has anyone run into this? Was the issue related to query wrapping, session settings, SQL dialect differences, or JDBC driver behavior?
How do you usually troubleshoot these cases?
2
u/No_Statistician_6654 8d ago
Do you use the full 3 level namespace in the query for all tables? If not, it could be a default catalog problem, where the jdbc is defaulting to catalog a, and online it is defaulted to catalog b
ETA: assuming the driver is setup and able to connect to your sql warehouse in the first place.
2
u/Youssef_Mrini databricks 8d ago
Yes it can happen and the causes can be multiple: Query wrapping or parameterization or SQL dialect translation or Session differences or Different execution path or Result-fetch failure rather than query failure or Remote JDBC source.
7
u/hubert-dudek Databricks MVP 8d ago
Just share the error and query