apache/seatunnel · warning

The String type in Doris can only store up to 2GB bytes…

Error message

The String type in Doris can only store up to 2GB bytes, and the current field [%s] length is [%s] bytes. If it is greater than the maximum length of the String in Doris, it may not be able to write data

What it means

AbstractDorisTypeConverter logs this warning when converting a SeaTunnel STRING column whose declared column length exceeds Doris's maximum String size (2GB, MAX_STRING_LENGTH). Doris String can hold at most 2,147,483,647 bytes, so a longer declared length cannot be honored; the converter still maps the column to DORIS_STRING and proceeds. Data longer than the Doris limit may fail to write at sink time.

Solutions

  1. Reduce the declared column length in the source or in a transform before writing to Doris
  2. Cap the column length in the catalog config / type mapping so it stays under 2GB bytes
  3. If data truly exceeds 2GB, split or truncate the field upstream; Doris String cannot store it
  4. Verify actual data sizes; often the declared length is inflated and real values fit fine (warning is safe to ignore then)

Example fix

// before: source column length reported as 4294967295 (MySQL LONGTEXT)
catalogTable.getFieldNames(); // column length 4294967295 -> warning
// after: constrain via transform/schema override so length <= 2147483647
row.field(0, new StringType()); // or cap length in type converter config
Defensive patterns

Strategy: validation

Validate before calling

if (column.getColumnLength() != null && column.getColumnLength() > 2147483647L) {
    // shorten/truncate the column or map it manually before Doris sink
}

Prevention

When it happens

Trigger: sampleReconvertString is called during schema conversion (e.g. sink table schema creation) with a source column whose getColumnLength() > MAX_STRING_LENGTH (2GB), typical when source metadata reports an unbounded/oversized VARCHAR/TEXT length.

Common situations: Syncing from sources like Oracle LONGTEXT, MySQL LONGTEXT, or a VARCHAR with huge declared length; JDBC drivers reporting Integer.MAX_VALUE length for text columns; auto table creation into Doris from such sources.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/datatype/AbstractDorisTypeConverter.java:235

                builder.dataType(DORIS_CHAR);
            }
            return;
        }

        if (column.getColumnLength() <= 65533) {
            builder.columnType(String.format("%s(%s)", DORIS_VARCHAR, column.getColumnLength()));
            builder.dataType(DORIS_VARCHAR);
            return;
        }

        if (column.getColumnLength() <= MAX_STRING_LENGTH) {
            builder.columnType(DORIS_STRING);
            builder.dataType(DORIS_STRING);
            return;
        }

        if (column.getColumnLength() > MAX_STRING_LENGTH) {
            log.warn(
                    String.format(
                            "The String type in Doris can only store up to 2GB bytes, and the current field [%s] length is [%s] bytes. If it is greater than the maximum length of the String in Doris, it may not be able to write data",
                            column.getName(), column.getColumnLength()));
            builder.columnType(DORIS_STRING);
            builder.dataType(DORIS_STRING);
            return;
        }

        throw CommonError.convertToConnectorTypeError(
                IDENTIFIER, column.getDataType().getSqlType().name(), column.getName());
    }

    /**
     * Maximum decimal scale accepted by the target Doris version.
     *
     * <p>DECIMALV3 only requires the scale to not exceed the precision, which the caller already
     * enforces, so the default imposes no further limit. Doris 1.x is stricter and overrides this.
     *

View on GitHub (pinned to cf67b549a7)