PostHog / PostHog/posthog

Improve data warehouse joins when uuid/id column types mismatch

Open
#40,941 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement feature/data-warehouse team/data-warehouse
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Feature request

Is your feature request related to a problem?

With data warehouse tables the column types can mismatch with those in PostHog tables, resulting in an error beginning with:

Can't infer common type for joined columns

The workaround is to use a SQL expression to coerce the uuid or id into a string type on one or both sides. But it seems that we could detect this situation better and attempt to do it for the user automatically.

Describe the solution you'd like

Better error handling to assist the user, or to do the coercion ourselves for the user.

Describe alternatives you've considered

Additional context

Ticket that encountered this: https://posthoghelp.zendesk.com/agent/tickets/41667 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/44127)

Debug info
- [x] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a data warehouse join between mismatched uuid/id columns and inspect where the “Can't infer common type for joined columns” error is handled. Compare automatic coercion with improved error guidance; done means users can complete the join without the type-mismatch failure or receive actionable guidance, with the linked support tickets providing context.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
data-engineering, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.