Skip to content

fix(data-export): handle bigint hourly cursors - #5350

Merged
pandemicsyn merged 1 commit into
mainfrom
fix/data-export-hourly-bigint
Aug 18, 2026
Merged

fix(data-export): handle bigint hourly cursors#5350
pandemicsyn merged 1 commit into
mainfrom
fix/data-export-hourly-bigint

Conversation

@pandemicsyn

Copy link
Copy Markdown
Contributor

Summary

  • Normalize PostgreSQL integer values returned as string, number, or bigint when exporting microdollar_usage_hourly.
  • Preserve the hourly source's numeric SQL ordering and expression-index predicates while converting exported country IDs and keyset cursors to stable strings.
  • Add regression coverage for the shared node-postgres INT8 parser returning both a real country ID and the null sentinel as JavaScript bigint values.

Verification

  • The production warehouse query was run manually for an affected personal export and returned hourly rows with bigint-backed country IDs and -1 null sentinels.
  • End-to-end export verification requires deployment because the failure occurs with the production Hyperdrive and shared node-postgres type parser.

Visual Changes

N/A

Reviewer Notes

  • The previous mapper accepted only number and string, but @kilocode/db/client globally parses PostgreSQL INT8 as JavaScript bigint. This caused every observed hourly source read to fail after a successful database query.
  • The SQL is intentionally unchanged so ORDER BY COALESCE(vercel_ip_country_id, -1) continues to match the warehouse expression indexes.

@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the hourly bigint cursor/country-id normalization and matching tests; the mapper now accepts the shared INT8 parser’s bigint values without changing SQL ordering or index predicates.

Files Reviewed (2 files)
  • services/user-data-export/src/source-adapters.ts
  • services/user-data-export/src/source-adapters.test.ts

Reviewed by grok-4.6 · Input: 70.8K · Output: 11.5K · Cached: 377.2K

Review guidance: REVIEW.md from base branch main

@pandemicsyn
pandemicsyn merged commit 39726d8 into main Aug 18, 2026
13 checks passed
@pandemicsyn
pandemicsyn deleted the fix/data-export-hourly-bigint branch August 18, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants