apache/seatunnel · warning

InfluxDB query returned no series (empty data), using defaul

Error message

InfluxDB query returned no series (empty data), using default column index mapping.

What it means

Same fallback path as the empty-results warning, but this one fires when the query returned results whose first Result contains no Series — i.e. the database responded but has no data/columns for the query. The connector logs this warning and uses buildDefaultColumnsIndex(), which may misalign field indexes with the real measurement schema.

Source

Thrown at seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/source/InfluxDBSource.java:126

        if (start > 0) {
            StringBuilder tmpSql = new StringBuilder(sql);
            tmpSql.insert(start - 1, QUERY_LIMIT).append(" ");
            query = tmpSql.toString();
        }

        try {
            QueryResult queryResult = influxdb.query(new Query(query, sourceConfig.getDatabase()));

            List<QueryResult.Result> results = queryResult.getResults();
            if (CollectionUtils.isEmpty(results)) {
                log.warn(
                        "InfluxDB query returned empty results, using default column index mapping.");
                return buildDefaultColumnsIndex();
            }

            List<QueryResult.Series> serieList = results.get(0).getSeries();
            if (CollectionUtils.isEmpty(serieList)) {
                log.warn(
                        "InfluxDB query returned no series (empty data), using default column index mapping.");
                return buildDefaultColumnsIndex();
            }

            List<String> fieldNames = new ArrayList<>(serieList.get(0).getColumns());

            return Arrays.stream(catalogTable.getSeaTunnelRowType().getFieldNames())
                    .map(fieldNames::indexOf)
                    .collect(Collectors.toList());
        } catch (Exception e) {
            throw new InfluxdbConnectorException(
                    InfluxdbConnectorErrorCode.GET_COLUMN_INDEX_FAILED,
                    "Get column index of query result exception",
                    e);
        }
    }

    /**

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Confirm the measurement has data for the query's time range/filters using the influx CLI
  2. Remove or widen time-range/WHERE filters in the connector query so metadata discovery returns series
  3. Verify measurement name casing matches exactly (InfluxDB measurement names are case-sensitive)
  4. If discovery keeps failing, explicitly configure the SeaTunnel schema (fields and types) instead of relying on automatic index mapping

Example fix

// before
query = "SELECT * FROM cpu WHERE time > now() - 1s"  // too narrow, no points
// after
query = "SELECT * FROM cpu WHERE time > now() - 1h"
Defensive patterns

Strategy: validation

Validate before calling

QueryResult qr = influxdb.query(new Query(query, database));
boolean hasSeries = qr.getResults() != null && !qr.getResults().isEmpty()
    && qr.getResults().get(0).getSeries() != null && !qr.getResults().get(0).getSeries().isEmpty();
if (!hasSeries) throw new IllegalStateException("Query returned no series: " + query);

Prevention

When it happens

Trigger: initColumnsIndex: results non-empty but results.get(0).getSeries() is null/empty — query matched a database/measurement with no points, or a query filtering out all data (e.g. WHERE clause, time range).

Common situations: Time-range or WHERE filters excluding all points; writing to a measurement that was never populated; case-sensitive measurement name mismatch; querying before any data ingestion ran.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/4da32f631493b075. Report an issue: GitHub.