apache/seatunnel · error · UnsupportedOperationException

Unsupported type in LocalTimeArrayType: ${eleSqlType}

Error message

Unsupported type in LocalTimeArrayType: ${eleSqlType}

What it means

When computing the serialized byte size of a SeaTunnelRow, array-typed fields with LocalTime element types are sized per-element, but only a subset of SQL types (like TIME/TIMESTAMP) have known fixed sizes. An unexpected element SqlType inside an array at that branch causes UnsupportedOperationException naming the element type.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/SeaTunnelRow.java:211

            case SPARSE_FLOAT_VECTOR:
                return ((Map<?, ?>) v).entrySet().size() * 8;
            case ARRAY:
                SeaTunnelDataType elementType = ((ArrayType) dataType).getElementType();
                if (elementType instanceof DecimalType) {
                    return ((Object[]) v).length * 36;
                }
                if (elementType instanceof LocalTimeType) {
                    SqlType eleSqlType = elementType.getSqlType();
                    switch (eleSqlType) {
                        case DATE:
                            return ((Object[]) v).length * 24;
                        case TIME:
                            return ((Object[]) v).length * 12;
                        case TIMESTAMP:
                        case TIMESTAMP_TZ:
                            return ((Object[]) v).length * 48;
                        default:
                            throw new UnsupportedOperationException(
                                    "Unsupported type in LocalTimeArrayType: " + eleSqlType);
                    }
                }

                return getBytesForArray(v, ((ArrayType) dataType).getElementType());
            case MAP:
                int size = 0;
                MapType<?, ?> mapType = ((MapType<?, ?>) dataType);
                for (Map.Entry<?, ?> entry : ((Map<?, ?>) v).entrySet()) {
                    size +=
                            getBytesForValue(entry.getKey(), mapType.getKeyType())
                                    + getBytesForValue(entry.getValue(), mapType.getValueType());
                }
                return size;
            case ROW:
                int rowSize = 0;
                SeaTunnelRowType rowType = ((SeaTunnelRowType) dataType);
                SeaTunnelDataType<?>[] types = rowType.getFieldTypes();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the array's element SqlType and avoid unsupported element types in LocalTime array fields
  2. Upgrade SeaTunnel — newer versions extend byte-size accounting to more types
  3. Compute sizes yourself for that field instead of relying on getBytesSize
  4. Convert the field to a supported array type (e.g. STRING) before size computation

Example fix

// before
int size = row.getBytesSize(); // throws for unsupported array element type
// after
int size = supportsByteSizing(fieldType) ? row.getBytesSize() : estimateSizeManually(row);
Defensive patterns

Strategy: try-catch

Validate before calling

SqlType ele = ((ArrayType) fieldType).getElementType().getSqlType();
boolean safe = ele == SqlType.TIME || ele == SqlType.TIMESTAMP || ele == SqlType.TIMESTAMP_TZ;

Try / catch

try {
    int size = row.getBytesSize();
} catch (UnsupportedOperationException e) {
    int size = manualSizeEstimate(row); // custom accounting for exotic arrays
}

Prevention

When it happens

Trigger: Calling getBytesSize()/getBytes() on a row containing an ArrayType field whose element type falls into the unsupported branch of the LocalTime-array sizing switch (an element SqlType not handled there).

Common situations: Rows with exotic array element types (e.g. arrays of NULL, ROW, or time variants) passed through size accounting, typically in serializers or metrics that compute record size.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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