You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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,
When really what has happened is we could not resolve
T.b
as the struct only has a fieldT.a
. The expressionupper(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 resolveb
.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.
The text was updated successfully, but these errors were encountered: