Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

Specify catalog query execution#31

Merged
muroon merged 3 commits into
speee:masterfrom
muroon:specify-catalog-query-execution
Feb 17, 2026
Merged

Specify catalog query execution#31
muroon merged 3 commits into
speee:masterfrom
muroon:specify-catalog-query-execution

Conversation

@muroon

@muroon muroon commented Feb 17, 2026

Copy link
Copy Markdown

What

Fix catalog handling in Athena query execution to properly support context overrides and prevent API errors with empty
catalog values.

Why

The previous change (#29 fork) added Catalog to QueryExecutionContext but had two issues:

  1. Breaking change for Open(Config{}) users: When Catalog is not explicitly set, aws.String("") sends an empty
    string to the Athena API, causing InvalidRequestException. Previously, the field was omitted and Athena used its
    default catalog.
  2. SetCatalog() context override ignored: startQuery() always used c.catalog from the connection struct,
    ignoring per-query catalog overrides set via SetCatalog(ctx, ...). This made the context-based catalog override
    non-functional for actual query execution.

Additionally, GetTableMetadata in GzipDL mode had the same empty string issue with CatalogName, which is a required
parameter.

How

  • In startQuery(): resolve catalog from context via getCatalog(ctx) with fallback to c.catalog, and use nil
    instead of aws.String("") when catalog is empty so Athena uses its default.
  • In getTableAsync(): fall back to "AwsDataCatalog" (the default catalog constant) when catalog is empty, since
    CatalogName is a required parameter for GetTableMetadata.

Ref

ryder-gillen-ltk and others added 3 commits October 22, 2025 18:35
- Resolve catalog from context in startQuery() to honor SetCatalog() overrides
- Use nil instead of empty string for Catalog in QueryExecutionContext
  to avoid API errors when catalog is not explicitly set
- Fall back to default "AwsDataCatalog" in GetTableMetadata where
  CatalogName is a required parameter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@muroon muroon merged commit c9a4ffa into speee:master Feb 17, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants