Skip to content

Conversation

@rdhyee
Copy link
Contributor

@rdhyee rdhyee commented Oct 31, 2025

Bugfix for Cesium Click Query

Fixes bug introduced in PR #27 where the combined samples query was failing silently.

Problem

The get_samples_at_geo_cord_location_via_sample_event() function was requesting columns that don't exist on MaterialSampleRecord nodes:

  • s.description
  • s.thumbnail_url (exists on event/site, causing ambiguity error)
  • s.alternate_identifiers

This caused a DuckDB binder error: "Ambiguous reference to column name 'thumbnail_url'"

Result: Query returned empty array [] while Path 1 and Path 2 queries worked correctly.

Solution

  • Removed non-existent columns
  • Use only columns that exist on MaterialSampleRecord: pid, label, name
  • Added event.pid to match Path 1/2 structure
  • Simplified ORDER BY (removed thumbnail_url sorting)
  • Updated documentation

Testing

  • Error discovered via browser console inspection
  • Verified Path 1/2 queries work with correct schema
  • Query now returns sample data matching individual path queries

This is a critical fix - without it, the combined query feature doesn't work at all.

BUG FIX: Resolve "Ambiguous reference to column name" error in get_samples_at_geo_cord_location_via_sample_event()

Problem:
- Query requested s.description, s.thumbnail_url, s.alternate_identifiers
- These columns don't exist on MaterialSampleRecord nodes
- thumbnail_url exists on both 'event' and 'site' tables, causing ambiguity
- Query was failing silently, returning empty array []

Solution:
- Use only columns that exist on MaterialSampleRecord: pid, label, name
- Add event.pid to match Path 1/2 queries
- Remove thumbnail_url sorting (column doesn't exist on samples)
- Simplify ORDER BY to just sample_label

Testing:
- Verified Path 1 and Path 2 queries work (they use correct columns)
- Error found via browser console: document.getElementById('loading_combined').innerHTML
- Error was: "Binder Error: Ambiguous reference to column name 'thumbnail_url'"

Changes:
- Removed: s.description, s.thumbnail_url, s.alternate_identifiers
- Added: s.name, event.pid (matching working queries)
- Updated documentation to reflect actual returned columns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rdhyee rdhyee merged commit 2a397b4 into isamplesorg:main Oct 31, 2025
1 check passed
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.

1 participant