Apache Software Foundation / SeaTunnel
Merged upstreamFeatureMerged Aug 30, 2026

Add a PostHog source connector

Implemented a bounded PostHog batch source that executes blocking HogQL queries and maps the returned columns and result arrays to a configured SeaTunnel schema.

apache/seatunnel · #11998

New analytics connector

SeaTunnel batch jobs can now execute bounded PostHog HogQL queries and map column-oriented results into typed pipeline rows.

Problem

SeaTunnel lacked a PostHog ingestion path, and the shared HTTP execution helper flattened nested JSON keys when round-tripping the HogQL request body through HOCON. That would silently transform PostHog's required nested query object into invalid dotted keys.

Approach

Added a dedicated source using the existing HTTP client, retry, and deserialization infrastructure while sending the serialized nested request body verbatim. The connector validates query status, response shape, duplicate and missing columns, row widths, reserved headers, and supported cloud or self-hosted endpoints.

Impact and scope

  • Lets teams bring bounded PostHog product-analytics queries directly into SeaTunnel batch pipelines.
  • Prevents nested HogQL payload corruption by preserving the exact JSON request structure across the HTTP boundary.
  • Fails early on incomplete or malformed query results instead of emitting ambiguous or misaligned rows.

Validation

  • Added 15 unit tests covering authentication, request construction, exact nested-body preservation, response conversion, query errors, and malformed column or row shapes.
  • Added MockServer E2E coverage that verifies the nested request and delivers two result rows to the Assert sink; the final Apache Build passed.
  • Both authored commits and the final merge commit are attributable to Goutam Adwant; the GitHub-verified merge received upstream approval.