Skip to content

How to query multiple tables from different buckets with inner join? #26898

@nasserHHDE

Description

@nasserHHDE

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions