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

Logictest projections #258

Merged
merged 5 commits into from
Nov 29, 2022
Merged

Logictest projections #258

merged 5 commits into from
Nov 29, 2022

Conversation

thorfour
Copy link
Contributor

This adds Projection support to Logictests as well as adding support for additional schemas.

Copy link
Member

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

nice!

logictest/schemas/default.json Outdated Show resolved Hide resolved
@@ -62,6 +62,8 @@ func (v *astVisitor) leaveImpl(n ast.Node) error {
v.exprStack[0],
v.exprStack[1:]...,
)
default:
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct to have this as the default case? I guess previously we just returned all columns, so we do want to do a Project in all cases, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we'd want to extend this to support something like select * in the future, but I think for what we have now this is okay?

return "", fmt.Errorf("createtable: unexpected schema values %v", arg.Vals)
}
schema = r.defaultSchema
schema = r.schemas[arg.Vals[0]]
Copy link
Member

Choose a reason for hiding this comment

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

nit: return an error if schema is not found

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do below where we check if schema is nil

logictest/logic_test.go Outdated Show resolved Hide resolved
@thorfour thorfour merged commit 48a8455 into main Nov 29, 2022
@thorfour thorfour deleted the logictest-projections branch November 29, 2022 21:29
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