Skip to content

Missing Array Accessor Methods in GenericRecord for ClickHouse Types #2738

@BentsiLeviav

Description

@BentsiLeviav

Describe your feedback

We're migrating Apache Beam's ClickHouseIO connector from JDBC driver v0.6.3 to ClickHouse Java Client v2. During test migration, we discovered several missing array accessor methods in the GenericRecord interface.

Array(DateTime) format inconsistency:

  • JDBC (via getString): [2030-10-09T08:07:06, 2031-10-09T08:07:06]
  • Java Client v2 (via getString): [2030-10-09 08:07:06, 2031-10-09 08:07:06] (missing T separator)
  • Missing method: getDateTimeArray() or getDateArray()

Array(Enum) - no accessor:

  • Column type: Array(Enum8('abc' = 1, 'cde' = 2))
  • getStringArray() throws: "Not a String type"
  • Workaround: Must use getString() instead
  • Missing method: getEnumArray() or proper getStringArray() support

Array(UInt64) - no accessor:

  • Neither getIntArray() nor getLongArray() work
  • Workaround: Must use getString()
  • Missing method: Proper unsigned long array accessor

Array(FixedString) - similar limitations

Generally, I might be worth:

  • Add typed array accessor methods for these ClickHouse types
  • Clarify why format differences exist between JDBC and Java Client representations
  • Document recommended patterns for handling these array types

Reference:

Original Beam JDBC test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions