apache/seatunnel · warning

Complex type {} mapped to STRING, consider using JSON serial

Error message

Complex type {} mapped to STRING, consider using JSON serialization

What it means

This is a warning (not an exception) emitted by DuckDBTypeConverter.convert when a source column has a complex DuckDB type (ARRAY, STRUCT, or MAP). SeaTunnel's catalog Column model cannot represent these nested types in this dialect path, so the converter degrades the column to BasicType.STRING_TYPE with length 65535 (or the original length if positive). Data is read/written as a flat string, so nested semantics are lost unless the job handles serialization itself.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/duckdb/DuckDBTypeConverter.java:179

                builder.dataType(LocalTimeType.LOCAL_DATE_TYPE);
                break;
            case DUCKDB_TIME:
                builder.dataType(LocalTimeType.LOCAL_TIME_TYPE);
                break;
            case DUCKDB_TIMESTAMP:
                builder.dataType(LocalTimeType.LOCAL_DATE_TIME_TYPE);
                break;
            case DUCKDB_TIMESTAMP_WITH_TZ:
                builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);
                break;
            case DUCKDB_INTERVAL:
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(50L);
                break;
            case DUCKDB_ARRAY:
            case DUCKDB_STRUCT:
            case DUCKDB_MAP:
                log.warn(
                        "Complex type {} mapped to STRING, consider using JSON serialization",
                        duckDBType);
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(lengthValue > 0 ? lengthValue : 65535);
                break;
            default:
                log.warn("Unsupported DuckDB type: {}, falling back to STRING", duckDBType);
                builder.dataType(BasicType.STRING_TYPE);
                builder.columnLength(lengthValue > 0 ? lengthValue : 255);
        }
        return builder.build();
    }

    private void handleDecimalType(
            PhysicalColumn.PhysicalColumnBuilder builder, BasicTypeDefine typeDefine) {
        long precision =
                typeDefine.getPrecision() != null ? typeDefine.getPrecision() : DEFAULT_PRECISION;
        int scale = typeDefine.getScale() != null ? typeDefine.getScale() : DEFAULT_SCALE;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. If JSON text is acceptable, keep the mapping and parse the string downstream (e.g. with a JSON transform).
  2. Pre-cast the column in your source SQL to a primitive type or VARCHAR/JSON before SeaTunnel reads the schema.
  3. Use a sink/connector that supports nested types, or enable JSON serialization at the storage layer instead of relying on this fallback.
  4. If the default 65535 length is wrong for your data, define the column explicitly in your sink schema.

Example fix

// before (source SQL)
SELECT info FROM users; -- info is STRUCT(name TEXT, age INT)
// after
SELECT json(info) AS info FROM users; -- explicit JSON string, parsed downstream
Defensive patterns

Strategy: validation

Validate before calling

for (Column c : columns) {
  if (c.getDataType() instanceof ArrayType || c.getDataType() instanceof MapType
      || (c.getDataType() instanceof RowType)) {
    // plan for string/JSON handling before submitting the job
  }
}

Type guard

boolean isComplex(Column c) {
  return c.getDataType() instanceof ArrayType
      || c.getDataType() instanceof MapType
      || c.getDataType() instanceof RowType;
}

Prevention

When it happens

Trigger: Calling convert (or reconvert indirectly) on a BasicTypeDefine whose DuckDB type resolves to DUCKDB_ARRAY, DUCKDB_STRUCT, or DUCKDB_MAP — e.g. catalog/schema discovery of a table containing LIST, STRUCT, or MAP columns.

Common situations: Reading a DuckDB table that stores JSON-ish nested data in STRUCT/LIST columns; syncing a table with MAP columns into another sink that receives plain VARCHAR; schema auto-creation writing STRING columns downstream instead of nested types.

Related errors


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