risingwavelabs/risingwave · error · ConnectorError

POLYGON type not supported

Error message

POLYGON type not supported

What it means

Type-mapping guard in mysql_type_to_rw_type: when a CDC schema snapshot or schema-change event from a MySQL source contains a POLYGON column, mapping to a RisingWave DataType is impossible (no spatial types), so the mapping returns an error and the source/schema change fails for tables with POLYGON columns.

Source

Thrown at src/connector/src/source/cdc/external/mysql.rs:432

        | ColumnType::TinyBlob
        | ColumnType::MediumBlob
        | ColumnType::LongBlob => DataType::Bytea,
        ColumnType::Enum(_) => DataType::Varchar,
        ColumnType::Json => DataType::Jsonb,
        ColumnType::Set(_) => {
            return Err(anyhow!("SET type not supported").into());
        }
        ColumnType::Geometry(_) => {
            return Err(anyhow!("GEOMETRY type not supported").into());
        }
        ColumnType::Point(_) => {
            return Err(anyhow!("POINT type not supported").into());
        }
        ColumnType::LineString(_) => {
            return Err(anyhow!("LINE string type not supported").into());
        }
        ColumnType::Polygon(_) => {
            return Err(anyhow!("POLYGON type not supported").into());
        }
        ColumnType::MultiPoint(_) => {
            return Err(anyhow!("MULTI POINT type not supported").into());
        }
        ColumnType::MultiLineString(_) => {
            return Err(anyhow!("MULTI LINE STRING type not supported").into());
        }
        ColumnType::MultiPolygon(_) => {
            return Err(anyhow!("MULTI POLYGON type not supported").into());
        }
        ColumnType::GeometryCollection(_) => {
            return Err(anyhow!("GEOMETRY COLLECTION type not supported").into());
        }
        ColumnType::Unknown(_) => {
            return Err(anyhow!("Unknown MySQL data type").into());
        }
    };

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Drop the POLYGON column from the CDC table.
  2. Expose it as text via ST_AsText (generated column) so it maps to VARCHAR.
  3. Ingest via a connector that supports geometry serialization instead of CDC.
  4. Check for RisingWave spatial-type support in newer versions.

Example fix

// before
CREATE TABLE zones (id INT PRIMARY KEY, area POLYGON);
// after
CREATE TABLE zones (id INT PRIMARY KEY, area_wkt TEXT AS (ST_AsText(area)));
Defensive patterns

Strategy: validation

Validate before calling

if col.data_type.eq_ignore_ascii_case("POLYGON") {
    return Err(format!("column '{}' is POLYGON; convert to WKT text before CDC", col.name));
}

Try / catch

match create_mysql_cdc_table().await {
    Err(e) if e.to_string().contains("POLYGON type not supported") => {
        eprintln!("Convert polygon column to text (ST_AsText) upstream");
    }
    other => other?,
}

Prevention

When it happens

Trigger: A MySQL CDC table's schema contains a POLYGON column when connect/parse_schema_change builds the RW schema.

Common situations: Geofencing or region-boundary tables; users CDC a table with area polygons and hit this during `CREATE TABLE ... connector='mysql-cdc'`.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/2c9dd48f46b7dca6. Report an issue: GitHub.