Documentation

Troubleshoot join operations

Learn how to troubleshoot common behaviors and errors that may occur when using the join package.

Submit issues for unexplained behaviors or errors

This is a “living” document that may be updated with common issues that users may run into when using the join package. If you have questions about a behavior or error that is not documented here, please submit an issue to either the InfluxData Documentation or Flux GitHub repositories:

Troubleshoot join behaviors

Columns explicitly mapped in the join are null

In some cases, your join output may include null values in columns where you expect non-null values. This may be caused by one of the following issues:


Cause

The group keys of each input stream aren’t the same. Functions in the join package use group keys to quickly identify what tables should be compared.

Solution

Use group() to regroup your two input streams so their group keys match before attempting to join them together.


Cause

There are no matching group key instances in your data streams. Functions in the join package only compare tables with matching group key instances. Input streams may have matching group keys, but there are no matching group key instances in your stream.

This may happen when joining two separate fields queried from InfluxDB. By default, InfluxDB returns data with _field as part of the group key. If each stream contains a different field, tables in the two streams won’t be compared because they won’t have any matching group key instances.

Solution

Use group() to remove any columns from the group keys of each input stream that would prevent group key instances from matching.


Troubleshoot join error messages

table is missing column '<column>'

Error message
cannot set join columns in left table stream: table is missing column '<column>'

Cause

Your on join predicate uses a column that doesn’t exist. In the on predicate function, you’re trying to compare a column that doesn’t exist in one of your input streams.

Solution

Ensure the columns that you’re comparing in the on predicate function exist in the input streams. If necessary, update column names in the predicate function.


table is missing label <label>

Error message
table is missing label <label>

Cause

Your on join predicate uses a column that doesn’t exist. In the on predicate function for an outer join, you’re trying to use a value from a column that doesn’t exist in the “primary” input stream (left for join.left() and right for join.right()).

Solution

Ensure the columns that you’re comparing in the on predicate function actually exist in the input streams. If necessary, update column names in the predicate function.


record is missing label <label>

Error message
record is missing label <label> (argument <left or right>)

Cause

Your on join predicate uses a column that doesn’t exist. In the on predicate function, you’re trying to compare a column that doesn’t exist in one of your input streams.

Solution

Ensure the columns that you’re comparing in the on predicate function actually exist in the input streams. If necessary, update column names in the predicate function.


Cause

Your as output schema function uses a column that doesn’t exist. If using an outer join, the as is trying to use a value from a column that doesn’t exist in the “primary” input stream (left for join.left() and right for join.right()).

Solution

Ensure the columns that you’re using in the as output function to assign values to the output actually exist in the input streams.


cannot join on an empty table

Error message
error preparing <left or right> side of join: cannot join on an empty table

Cause

One of your input streams is an empty stream of tables. Functions in the join package error when one or both of the input streams are empty.

Solution

Use array.from() and union() to insert a dummy table into each stream that you filter out after the join operation. The dummy table needs to include all group key columns of the stream it is unioned with.


Was this page helpful?

Thank you for your feedback!


Introducing InfluxDB Clustered

A highly available InfluxDB 3.0 cluster on your own infrastructure.

InfluxDB Clustered is a highly available InfluxDB 3.0 cluster built for high write and query workloads on your own infrastructure.

InfluxDB Clustered is currently in limited availability and is only available to a limited group of InfluxData customers. If interested in being part of the limited access group, please contact the InfluxData Sales team.

Learn more
Contact InfluxData Sales

The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following:

State of the InfluxDB Cloud Serverless documentation

InfluxDB Cloud Serverless documentation is a work in progress.

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.