Skip to content

[Bug] HiveCatalog fails to create tables with column comments longer than 256 characters #9072

Description

@thswlsqls

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ a5e87eb (2.1-SNAPSHOT)

Compute Engine
Engine-agnostic — any engine using the Paimon Hive catalog

Minimal reproduce step
Through a Paimon Hive catalog, run CREATE TABLE t (c INT COMMENT '<300 characters>').

HiveCatalog.convertToFieldSchema() (paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java) passes DataField.description() to FieldSchema unchanged, but the metastore maps COLUMNS_V2.COMMENT to VARCHAR(256) in package.jdo.

What doesn't meet your expectations?
Expected: the table is created. Actual: Paimon writes the schema file, then the metastore rejects the insert and the statement fails:

RuntimeException: Failed to create table db.t
  -> MetaException: Add request failed : INSERT INTO COLUMNS_V2 ...
  -> SQLDataException: A truncation error was encountered trying to shrink VARCHAR '...' to length 256.

Anything else?
The sibling path IcebergHiveMetadataCommitter.convertToFieldSchema() in the same module already normalizes comments (#8223, #8918). HiveCatalog was missed by both fixes.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions