2 weeks ago
Hi Databricks Community,
I'm experiencing an unusual issue when connecting DBeaver to Databricks Unity Catalog (UC) through a SQL Pro Warehouse and would appreciate insights from anyone who has encountered similar behavior.
Client: DBeaver
Platform: Databricks on AWS
Catalog: Unity Catalog
Compute: Databricks SQL Pro Warehouse
When I establish a connection from DBeaver to Databricks Unity Catalog, I notice that queries are being submitted to the SQL Pro Warehouse even though I haven't manually executed any SQL statements.
This appears to generate unnecessary query activity and eventually overload the SQL warehouse.
I'm wondering whether DBeaver is automatically executing metadata discovery queries, catalog/schema introspection, or background queries.
While troubleshooting the above issue, I attempted to stop and restart the SQL Pro Warehouse.
However, I observed the following behavior:
The Databricks compute transitioned into a Failed state.
The underlying AWS EC2 instances continued running for an extended period.
The instances did not appear to terminate promptly, even though the Databricks compute was no longer operational.
This raises concerns about compute lifecycle management, resource utilization, and potentially unnecessary AWS infrastructure costs.
DBeaver Background Queries: Is it expected for DBeaver to automatically trigger SQL queries when connecting to Unity Catalog? Are there recommended DBeaver settings to limit metadata discovery or background queries?
SQL Pro Warehouse Performance: Has anyone experienced high query volume or warehouse overload caused by JDBC clients such as DBeaver?
Warehouse Lifecycle: What could cause a SQL Pro Warehouse to enter a Failed state during a stop/restart operation while its underlying EC2 instances remain active?
EC2 Resource Cleanup: What is the expected behavior for EC2 instance termination when a SQL Pro Warehouse fails or is stopped? Is there a recommended way to verify that resources are released properly?
Best Practices: Are there recommended JDBC connection properties, DBeaver configurations, or Databricks warehouse settings to prevent unnecessary background queries and manage compute resources efficiently?
Ideally, connecting DBeaver to Unity Catalog should not generate excessive background query activity, and stopping or restarting a SQL warehouse should result in predictable resource cleanup.
I'd be interested to hear whether others have encountered similar issues and what configuration changes or troubleshooting steps helped resolve them.
Thanks in advance for your suggestions!
Tags: Databricks, Unity Catalog, DBeaver, SQL Warehouse, SQL Pro, JDBC, AWS, Performance, Compute Management
2 weeks ago
DBeaver does run metadata queries on its own. When you connect and expand the tree it lists catalogs, schemas, tables and columns, and each of those is a statement sent to the warehouse, so they show up in Query History even though you never typed anything. An open connection also keeps the warehouse from auto-stopping, and with a big metastore the introspection can be a lot of statements. If you filter Query History by your user you should see SHOW and information_schema style statements, which would confirm it.
On the DBeaver side, the Databricks driver page in their docs says metadata reads can cost compute and mentions a way to switch them off. I couldn't confirm the exact steps, so check that page. Adding a connection filter so the navigator only looks at the one catalog and schema you work in should also cut it down.
For the failed warehouse with EC2 still running: a Pro warehouse runs in your own AWS account, so those instances are yours and billed by AWS, which is why it matters. I don't know of a documented reason for a stop ending in Failed with instances left behind, so I wouldn't guess at the cause. I'd note the warehouse ID, look in the EC2 console to see whether the instances are still running and tagged with it, and open a support ticket with that ID and the time of the failure. Once support confirms they're orphaned you can terminate them by hand. In the meantime a short auto stop and a low max cluster count limit how much a stuck connection can spin up.
If you can paste a few Query History rows from a period where you weren't typing anything, it'll be easier to say what DBeaver is actually sending.
2 weeks ago
a week ago
Hi Venkat, these are two separate issues.
1. DBeaver background queries Yes, this is expected. On connect, DBeaver reads metadata to fill the navigator, autocomplete and table info. It does this by running SHOW/DESCRIBE and information_schema queries. With a big Unity Catalog, that can mean a lot of queries. Keep-alive pings and idle JDBC sessions can also keep the warehouse awake even when you're not running anything.
To check what's being sent, open DBeaver's Query Manager with all query types shown. Then filter Databricks Query History by your user or client application.
To cut it down:
Preferences > Connections > Metadata: tick "Do not read tables information in SQL and data editors". You lose some autocomplete, but it stops most background reads.
SQL Editor > Code Editor: turn off "Read database table/column for semantic analysis".
Connection > Initialization: turn keep-alive off, or set it to a long interval.
Set a default catalog and schema in the JDBC URL with ConnCatalog and ConnSchema. Use navigator filters too, so DBeaver doesn't crawl every catalog.
Use the latest Databricks JDBC driver.
Heavy information_schema traffic can also get rate limited on the Unity Catalog side, which shows up as slow metadata queries or REQUEST_LIMIT_EXCEEDED. That's another reason to cut the metadata reads.
2. Warehouse failed and EC2 instances kept running Pro warehouses run their EC2 instances in your AWS account, so a failure here is usually caused by something on the AWS side. Common causes:
Missing permissions on the cross-account IAM role. If ec2:TerminateInstances is missing, Databricks can't clean up.
Subnets running out of IP addresses, or not enough EC2 capacity in the AZ.
An invalid instance profile in the SQL data access settings.
Someone editing or removing the Databricks tags on the instances.
To check what's still running:
In EC2, filter by the tag SqlEndpointId = <your warehouse ID>, or Vendor = Databricks.
Check the warehouse's monitoring tab, or system.compute.warehouse_events, for the failure reason.
If instances are still running well after the warehouse stopped, open a support ticket with the warehouse ID. Don't terminate them by hand until you know why.
Best practices
Consider a serverless warehouse for ad-hoc tools like DBeaver. It starts in seconds and stops quickly, and there are no EC2 instances in your account to manage.
Use a short auto stop, and a separate small warehouse for ad-hoc work.
Keep DBeaver's metadata reads limited as above.
Docs:
2 weeks ago
DBeaver does run metadata queries on its own. When you connect and expand the tree it lists catalogs, schemas, tables and columns, and each of those is a statement sent to the warehouse, so they show up in Query History even though you never typed anything. An open connection also keeps the warehouse from auto-stopping, and with a big metastore the introspection can be a lot of statements. If you filter Query History by your user you should see SHOW and information_schema style statements, which would confirm it.
On the DBeaver side, the Databricks driver page in their docs says metadata reads can cost compute and mentions a way to switch them off. I couldn't confirm the exact steps, so check that page. Adding a connection filter so the navigator only looks at the one catalog and schema you work in should also cut it down.
For the failed warehouse with EC2 still running: a Pro warehouse runs in your own AWS account, so those instances are yours and billed by AWS, which is why it matters. I don't know of a documented reason for a stop ending in Failed with instances left behind, so I wouldn't guess at the cause. I'd note the warehouse ID, look in the EC2 console to see whether the instances are still running and tagged with it, and open a support ticket with that ID and the time of the failure. Once support confirms they're orphaned you can terminate them by hand. In the meantime a short auto stop and a low max cluster count limit how much a stuck connection can spin up.
If you can paste a few Query History rows from a period where you weren't typing anything, it'll be easier to say what DBeaver is actually sending.
2 weeks ago
a week ago
Hi Venkat, these are two separate issues.
1. DBeaver background queries Yes, this is expected. On connect, DBeaver reads metadata to fill the navigator, autocomplete and table info. It does this by running SHOW/DESCRIBE and information_schema queries. With a big Unity Catalog, that can mean a lot of queries. Keep-alive pings and idle JDBC sessions can also keep the warehouse awake even when you're not running anything.
To check what's being sent, open DBeaver's Query Manager with all query types shown. Then filter Databricks Query History by your user or client application.
To cut it down:
Preferences > Connections > Metadata: tick "Do not read tables information in SQL and data editors". You lose some autocomplete, but it stops most background reads.
SQL Editor > Code Editor: turn off "Read database table/column for semantic analysis".
Connection > Initialization: turn keep-alive off, or set it to a long interval.
Set a default catalog and schema in the JDBC URL with ConnCatalog and ConnSchema. Use navigator filters too, so DBeaver doesn't crawl every catalog.
Use the latest Databricks JDBC driver.
Heavy information_schema traffic can also get rate limited on the Unity Catalog side, which shows up as slow metadata queries or REQUEST_LIMIT_EXCEEDED. That's another reason to cut the metadata reads.
2. Warehouse failed and EC2 instances kept running Pro warehouses run their EC2 instances in your AWS account, so a failure here is usually caused by something on the AWS side. Common causes:
Missing permissions on the cross-account IAM role. If ec2:TerminateInstances is missing, Databricks can't clean up.
Subnets running out of IP addresses, or not enough EC2 capacity in the AZ.
An invalid instance profile in the SQL data access settings.
Someone editing or removing the Databricks tags on the instances.
To check what's still running:
In EC2, filter by the tag SqlEndpointId = <your warehouse ID>, or Vendor = Databricks.
Check the warehouse's monitoring tab, or system.compute.warehouse_events, for the failure reason.
If instances are still running well after the warehouse stopped, open a support ticket with the warehouse ID. Don't terminate them by hand until you know why.
Best practices
Consider a serverless warehouse for ad-hoc tools like DBeaver. It starts in seconds and stops quickly, and there are no EC2 instances in your account to manage.
Use a short auto stop, and a separate small warehouse for ad-hoc work.
Keep DBeaver's metadata reads limited as above.
Docs: