fix: DuckDB TIMESTAMPTZ and TIMETZ columns displaying as null (#424)#427
fix: DuckDB TIMESTAMPTZ and TIMETZ columns displaying as null (#424)#427
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe DuckDB plugin was updated to fix temporal columns (TIMESTAMPTZ, TIMETZ, etc.) displaying as null. Changes include post-processing query results with a TZ column patcher, implementing fallback type conversions when varchar extraction fails, and extending type name recognition for additional DuckDB temporal and numeric types. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
duckdb_value_varcharreturns nilRoot cause
DuckDB v1.5.0 C API
duckdb_value_varchar()returns NULL for TIMESTAMPTZ and TIMETZ columns.duckdb_value_is_null()is also unreliable for these types. The deprecatedduckdb_column_data()works for TIMESTAMPTZ but not TIMETZ.Approach
CASE WHEN col IS NULL THEN NULL ELSE CAST(col AS VARCHAR) ENDfor TZ columns, then patch resultsduckdb_value_timestamp,duckdb_value_int*, etc.typeName(for:)Closes #424
Test plan
SELECT '2026-03-22T12:00:00Z'::timestamptz AS tmshows timestamp valueSELECT '12:00:00+05:30'::timetz AS tshows time with offsetSummary by CodeRabbit