cube-js/cube · error · Error

Unsupported mapping for data type: ${typeId}

Error message

Unsupported mapping for data type: ${typeId}

What it means

getNativeTypeName maps MySQL wire-protocol type IDs to Cube's native type strings via the MySqlNativeToMySqlType table; it throws when a column's typeId has no entry — i.e. streaming results (downloadQueryResults/stream) encountered a MySQL data type the driver does not know how to translate, commonly an unlisted geometry/JSON/binary variant or a new type from a server version. The input at fault is an unmapped numeric typeId.

Source

Thrown at packages/cubejs-mongobi-driver/src/MySQLType.ts:62

  [MySQLType.TIMESTAMP]: 'timestamp',
  [MySQLType.DATETIME]: 'datetime',
  [MySQLType.TIME]: 'time',
  [MySQLType.TINY_BLOB]: 'tinytext',
  [MySQLType.MEDIUM_BLOB]: 'mediumtext',
  [MySQLType.LONG_BLOB]: 'longtext',
  [MySQLType.BLOB]: 'text',
  [MySQLType.VAR_STRING]: 'varchar',
  [MySQLType.STRING]: 'binary',
  [MySQLType.FLOAT]: 'float',
  [MySQLType.DOUBLE]: 'double',
};

export function getNativeTypeName(typeId: MySQLType) {
  if (typeId in MySqlNativeToMySqlType) {
    return MySqlNativeToMySqlType[typeId];
  }

  throw new Error(
    `Unsupported mapping for data type: ${typeId}`
  );
}

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Extend MySqlNativeToMySqlType in MySQLType.ts with a mapping entry for the reported MySQL wire-protocol type id
  2. If the type is genuinely unsupported by the BI connector, cast/convert the column in the schema (e.g. to string) so the raw type never reaches getNativeTypeName
  3. Upgrade the mongobi driver package — newer releases may include additional type mappings
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cubejs-mongobi-driver/src/MySQLType.ts:62 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/149a32ea990294c7. Report an issue: GitHub.