apache/beam · error · ValueError

Encountered a type that is not currently supported by RowCod

Error message

Encountered a type that is not currently supported by RowCoder: %s

What it means

RowCoder encodes Beam schema rows and _nonnull_coder_from_type maps each schema field's Beam FieldType to a standard coder. Some field types supported by the Java SDK (and some exotic/logical types) have no standard Python coder implementation yet, so an unsupported field type raises ValueError.

Source

Thrown at sdks/python/apache_beam/coders/row_coder.py:195

      # unknown Python object.
      return typecoders.registry.get_coder(object)
    elif field_type.logical_type.urn == common_urns.millis_instant.urn:
      # Special case for millis instant logical type used to handle Java sdk's
      # millis Instant. It explicitly uses TimestampCoder which deals with fix
      # length 8-bytes big-endian-long instead of VarInt coder.
      return TimestampCoder()
    elif field_type.logical_type.urn == 'beam:logical_type:decimal:v1':
      return DecimalCoder()

    logical_type = LogicalType.from_runner_api(field_type.logical_type)
    return LogicalTypeCoder(
        logical_type, _coder_from_type(field_type.logical_type.representation))
  elif type_info == "row_type":
    return RowCoder(field_type.row_type.schema)

  # The Java SDK supports several more types, but the coders are not yet
  # standard, and are not implemented in Python.
  raise ValueError(
      "Encountered a type that is not currently supported by RowCoder: %s" %
      field_type)


class LogicalTypeCoder(FastCoder):
  def __init__(self, logical_type, representation_coder):
    self.logical_type = logical_type
    self.representation_coder = representation_coder

  def _create_impl(self):
    return LogicalTypeCoderImpl(self.logical_type, self.representation_coder)

  def is_deterministic(self):
    return self.representation_coder.is_deterministic()

  def to_type_hint(self):
    return self.logical_type.language_type()

View on GitHub (pinned to 12126d8942)

Solutions

  1. Upgrade apache-beam to a version whose RowCoder supports the offending field type
  2. Change the schema field to a supported type (e.g. use bytes/string representation for the unsupported logical type)
  3. Set a custom representation for the LogicalType so its representation maps to a supported coder
  4. If the schema comes from a Java/other-SDK pipeline, adjust the cross-language stage or code the field as bytes

Example fix

// before
# schema field of unsupported logical type
@dataclass
class Row:
  fancy: MyUnsupportedLogicalType
// after
@dataclass
class Row:
  fancy: str  # logical type represented as its string representation
Defensive patterns

Strategy: validation

Validate before calling

from apache_beam.typehints import schema
for name, ftype in schema_schema_fields:
    if str(ftype.type_info) not in {'atomic_type','array_type','iterable_type','map_type','logical_type','row_type'}:
        raise ValueError(f'field {name}: unsupported RowCoder type {ftype}')

Try / catch

try:
    coder = RowCoder(schema)
except ValueError as e:
    log.error('RowCoder cannot encode schema: %s', e)
    raise

Prevention

When it happens

Trigger: Creating a RowCoder for a schema containing a field whose FieldType (atomic, array, map, iterable, logical, row aside) has no implemented mapping in _coder_from_type/_nonnull_coder_from_type.

Common situations: Cross-language pipelines where a Java-defined schema includes types not yet standard in the Python SDK; schemas inferred from dataclasses/typed rows containing unsupported logical types; SDK version skew between writer and reader.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/ce75eae99ac02992. Report an issue: GitHub.