Skip to content

Commit 55fabbe

Browse files
rdhyeeclaude
andauthored
Fix zenodo_isamples_analysis: alias columns to match Jan 2026 wide parquet (#56)
The page queries used old column names (sample_location_latitude, source_collection) but the Jan 2026 wide parquet has different names (latitude, longitude, n). Added column aliases in the view creation so all downstream queries work without rewriting. Material category analysis section will show empty since the wide format stores these as integer arrays (p__has_material_category) rather than string values. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50e5fd7 commit 55fabbe

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tutorials/zenodo_isamples_analysis.qmd

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,16 @@ db = {
169169
170170
if (working_parquet_url) {
171171
try {
172-
// Try to create view of the remote parquet file
173-
await conn.query(`CREATE VIEW isamples_data AS SELECT * FROM read_parquet('${working_parquet_url}')`);
174-
172+
// Create view with aliased column names to match downstream queries.
173+
// The Jan 2026 wide parquet uses different names than the original schema.
174+
await conn.query(`CREATE VIEW isamples_data AS SELECT *,
175+
latitude AS sample_location_latitude,
176+
longitude AS sample_location_longitude,
177+
n AS source_collection,
178+
pid AS sample_identifier,
179+
CAST(NULL AS VARCHAR) AS has_material_category
180+
FROM read_parquet('${working_parquet_url}')`);
181+
175182
// Test the connection with a simple query to catch rate limiting
176183
await conn.query(`SELECT count(*) FROM isamples_data LIMIT 1`);
177184
console.log("✅ Successfully connected to remote Parquet file");

0 commit comments

Comments
 (0)