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

Improve unresolved variable messaging when appearing in the context of a builtin. #1348

Open
RCHowell opened this issue Jan 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@RCHowell
Copy link
Contributor

Requested Solution/Feature

Today, we do not immediately propagate an unresolved variable error when performing function resolution. Instead we pass the error node as a MISSING expression into function resolution. The result is that the error message is confusing. It appears like we weren't able to resolve a function, but really we weren't able to resolve a function because we couldn't resolve on of its arguments.

For example,

T : << { a: int } >>

SELECT upper(b) FROM T

-- !! ERROR Unknown function `upper(<missing>)`

When really what has happened is we could not resolve T.b as the struct only has a field T.a. The expression upper(MISSING) is sent to the function resolver which kicks this back saying that's not a valid function. But it's only not valid because we couldn't resolve b.

Describe Alternatives

...

Additional Context

We should check errors here, https://github.com/partiql/partiql-lang-kotlin/blob/main/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/PlanTyper.kt#L585

DoD (Definition of Done)

List set of criteria that characterize this issue as DONE or COMPLETED.

@RCHowell RCHowell added the enhancement New feature or request label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant