AirbyteValueCoercer

@Singleton
class AirbyteValueCoercer(@Property(name = "airbyte.destination.core.coercion.use-fast-timestamp-parsing") useFastTimestampParsing: Boolean = false)

Utility class to coerce AirbyteValue to specific types. Does not support recursive coercion.

More specifically: This class coerces the output of JsonToAirbyteValue to strongly-typed AirbyteValue. In particular, this class will parse temporal types, and performs some common-sense conversions among numeric types, as well as upcasting any value to StringValue.

The useFastTimestampParsing flag controls timestamp parsing behavior:

  • When false (default): uses the original try-ZonedDateTime/catch-fallback-to-LocalDateTime pattern. Safe but slow due to exception-as-control-flow.

  • When true: uses ethlo/itu for fast ISO-8601 parsing (~25x faster) with a JDK TemporalQueries fallback for exotic formats. No exceptions on the hot path.

Destinations opt in via the Micronaut property airbyte.destination.core.coercion.use-fast-timestamp-parsing.

Constructors

Link copied to clipboard
constructor(@Property(name = "airbyte.destination.core.coercion.use-fast-timestamp-parsing") useFastTimestampParsing: Boolean = false)

Functions

Link copied to clipboard
fun coerce(value: AirbyteValue, type: AirbyteType, respectLegacyUnions: Boolean = false): AirbyteValue?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard