influxdata / influxdata/influxdb
How to query multiple tables from different buckets with inner join?
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
**Describe the issue**
In InfluxDB 3.4, attempting to perform an INNER JOIN on tables that originate from different buckets fails. This limits the ability to perform cross-bucket analysis, which is especially important for users with data logically separated by bucket (e.g., metrics and events).
Steps to reproduce
Create two buckets: bucketA and bucketB
Write data into each (e.g., cpu data in bucketA, and alerts in bucketB)
Attempt the following SQL-like query:
```
SELECT *
FROM bucket_1.cpu a
INNER JOIN bucket_2.alerts b
ON a.host = b.host AND a.time = b.time
```
Query fails or returns errors.
**Expected behavior**
The join should return rows where host and time match across the two tables, even if they come from different buckets.
**Actual behavior**
The query either fails with a syntax or execution error
`Query execution failed: API response error: "query error: error while planning query: Error during planning: table 'public.bucket_1.cpu' not found"`
No clear documentation that this use case is unsupported
**Environment**
InfluxDB version: 3.4
Query language: SQL from both Explorer UI and HTTP API
Contributor guide
Research direction
The issue names no source files or tests. Start by reproducing the cross-bucket INNER JOIN through the Explorer UI or HTTP API and inspect the planner error; trace how table names are resolved. Done means matching rows can be returned across buckets, with coverage for the reported query or a clear documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100