Skip to content

[fixidx] Table function expression ids#2305

Merged
max-hoffman merged 3 commits intomainfrom
max/table-alias-exec-idx
Jan 31, 2024
Merged

[fixidx] Table function expression ids#2305
max-hoffman merged 3 commits intomainfrom
max/table-alias-exec-idx

Conversation

@max-hoffman
Copy link
Copy Markdown
Contributor

Simplify and fix plan.TableAlias indexing. Some table alias children have their own expression ids, but sql.TableFunction implementations don't necessarily extend the plan.TableIdNode interface and rely on the analyzer to populate column ids. There are a couple ways to simplify this in the future, like adding an intermediate prunable sql.Projector node for table functions, or having pruning clean up after itself by updating node and parent table alias columns.

TODO: this case is kind of hard to test, but trying to come up with something.

Copy link
Copy Markdown
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Code changes look reasonable. Only comment is that it would be helpful to have a test for this logic in the GMS layer, like we were talking about on Discord.

@max-hoffman
Copy link
Copy Markdown
Contributor Author

Thanks! Added a table function script test that mimics the failure in Dolt.

@max-hoffman max-hoffman merged commit b0718a7 into main Jan 31, 2024
@max-hoffman max-hoffman deleted the max/table-alias-exec-idx branch January 31, 2024 18:56
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