Skip to content

Add support for three-part column references#265

Open
malensek wants to merge 3 commits into
hyrise:mainfrom
malensek:main
Open

Add support for three-part column references#265
malensek wants to merge 3 commits into
hyrise:mainfrom
malensek:main

Conversation

@malensek

Copy link
Copy Markdown

This adds support for three-part column references:

SELECT schema.table.column FROM table;

So something like SELECT catalog.students.grade FROM students; will populate the schema field in Expr:

expr->schema = "catalog";
expr->table = "students";
expr->name = "grade";

The changes are fairly light:

  • Added a grammar entry for IDENTIFIER '.' IDENTIFIER '.' IDENTIFIER
  • Added Expr::makeColumnRef(char* schema, char* table, char* name)
  • Added a test case covering this scenario

I have confirmed this passes the test suite and leak test on Linux 6.18.35-1-lts and test suite on macOS 26.5.1. I also see that the repo has the Bison output checked in so I did so as well for this PR, but please let me know if I should exclude it or need to run with the same version of Bison that was previously used to generate the files.

Thanks for this great library, it's very clean and easy to work with!

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