Skip to content

Conversation

@HazelYuAhiru
Copy link
Collaborator

@HazelYuAhiru HazelYuAhiru commented Oct 2, 2025

This PR introduces a basic structure for the new query AST design. The structure can be divided into the following categories:

  • Class Node (abstract superclass for all nodes in the tree)
  • Specific tree nodes: TableNode, ColumnNode, etc.
  • Query structure nodes: SelectNode, FromNode, WhereNode, etc.

Todos (just for reference)

  • Refine the naming of files, classes, and fields as needed.
  • Simplify how specific children are retrieved from a parent node. Currently, this is done by index, which can be nested and confusing. We might consider implementing class methods that retrieve children based on identifiers or names.
  • Add scoping-related functionality. (after we have some unit tests)
  • Add Join-related functionality. (after we have some unit tests)

Simplifying the NodeTypes by generalizing different operators into one OperatorNode model;
Using Set semantics for most query structure's children;
Making sure VarSQL variables use set semantics;
Rewriting the tests accordingly;
baiqiushi
baiqiushi previously approved these changes Oct 6, 2025
colinthebomb1
colinthebomb1 previously approved these changes Oct 6, 2025
Copy link
Collaborator

@colinthebomb1 colinthebomb1 left a comment

Choose a reason for hiding this comment

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

LGTM, left one small comment

@baiqiushi baiqiushi dismissed stale reviews from colinthebomb1 and themself via 0549160 October 7, 2025 03:18
@HazelYuAhiru HazelYuAhiru merged commit 321549f into main Oct 8, 2025
2 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.

4 participants