apache/seatunnel · error · FileConnectorException

COMMON_ERROR_CODE-17

COMMON_ERROR_CODE-17

Error message

SeaTunnel array type not support this type [%s] now

What it means

When converting Parquet field values to SeaTunnel types, an ARRAY-typed field switches on the declared element SQL type; an element type outside the supported set has no conversion and raises UNSUPPORTED_DATA_TYPE. The message names the offending element SqlType.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/ParquetReadStrategy.java:652

                        byte[][] bytesArray = new byte[origArray.size()][];
                        for (int i = 0; i < origArray.size(); i++) {
                            Object element = origArray.get(i);
                            if (element instanceof ByteBuffer) {
                                ByteBuffer buffer = (ByteBuffer) element;
                                byte[] bytes = new byte[buffer.remaining()];
                                buffer.get(bytes, 0, bytes.length);
                                bytesArray[i] = bytes;
                            } else if (element instanceof byte[]) {
                                bytesArray[i] = (byte[]) element;
                            }
                        }
                        return bytesArray;
                    default:
                        String errorMsg =
                                String.format(
                                        "SeaTunnel array type not support this type [%s] now",
                                        elementType.getSqlType());
                        throw new FileConnectorException(
                                CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE, errorMsg);
                }
            case MAP:
                HashMap<Object, Object> dataMap = new HashMap<>();
                SeaTunnelDataType<?> keyType = ((MapType<?, ?>) fieldType).getKeyType();
                SeaTunnelDataType<?> valueType = ((MapType<?, ?>) fieldType).getValueType();
                HashMap<Object, Object> origDataMap = (HashMap<Object, Object>) field;
                origDataMap.forEach(
                        (key, value) ->
                                dataMap.put(
                                        resolveObject(key, keyType),
                                        resolveObject(value, valueType)));
                return dataMap;
            case BOOLEAN:
                return Boolean.parseBoolean(field.toString());
            case INT:
                return Integer.parseInt(field.toString());
            case BIGINT:

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the configured schema's array element type and align it with supported element SQL types (primitives).
  2. Flatten nested arrays into multiple columns or rows upstream.
  3. Store complex elements as JSON strings in the parquet file.
  4. Extend the array conversion switch to support the needed element type if justified.

Example fix

// before (schema)
{"name":"tags","type":"array<map<string,string>>"}

// after
{"name":"tags","type":"array<string>"} // elements pre-serialized as JSON
Defensive patterns

Strategy: validation

Validate before calling

// Validate configured array element types against the supported set
SqlType elem = ((ArrayType<?, ?>) fieldType).getElementType().getSqlType();
Set<SqlType> ok = EnumSet.of(SqlType.STRING, SqlType.BOOLEAN, SqlType.TINYINT,
    SqlType.SMALLINT, SqlType.INT, SqlType.BIGINT, SqlType.FLOAT, SqlType.DOUBLE,
    SqlType.DECIMAL, SqlType.BYTES);
if (!ok.contains(elem)) {
    throw new IllegalStateException("Unsupported array element type in schema: " + elem);
}

Type guard

static boolean hasSupportedArrayElements(SeaTunnelDataType<?> t) {
    return !(t instanceof ArrayType<?, ?> a)
        || EnumSet.of(SqlType.STRING, SqlType.INT, SqlType.BIGINT, SqlType.DOUBLE,
                      SqlType.FLOAT, SqlType.BOOLEAN).contains(a.getElementType().getSqlType());
}

Try / catch

try {
    rows = parquetSource.read();
} catch (FileConnectorException e) {
    if (e.getMessage().contains("SeaTunnel array type not support")) {
        // adjust schema element type or re-serialize upstream
    } else throw e;
}

Prevention

When it happens

Trigger: parquet schema (avro) field maps to SeaTunnel ArrayType whose elementType.getSqlType() hits the default branch — e.g. array of MAP/ROW/complex or other unsupported element types.

Common situations: Declaring SeaTunnel schema array<map<...>> for a parquet list column; parquet list of nested structs; schema mapping mismatches between the configured schema and the file.

Related errors


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