Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for IsRowId before accessing column name #9542

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

stephaniewang526
Copy link
Contributor

@stephaniewang526 stephaniewang526 commented Nov 1, 2023

We do some re-optimization in our code and this situation arised during query re-optimizing when running this query:

SELECT COUNT(*) FROM read_json_auto('s3://md-datadog-bucket/query_text/dt=20230711/hour=00/archive_000446.1149.w2NpeZP2QpSHycYt6sAFWA.json.gz')

INTERNAL Error: Attempted to access index -1 within vector of size 12

(There are 12 columns in the JSON file and the code in MultiFileReader::ComplexFilterPushdown is trying to access -1 (which is ROWID, i.e. -1 as column_id) )

This change fixes the issue. Also, it is safer to check we're not accessing IsRowId (i.e. -1) in column names vector.

Copy link
Collaborator

@Mytherin Mytherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@Mytherin Mytherin merged commit 65fc99f into duckdb:main Nov 3, 2023
43 checks 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.

2 participants