-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql/parser: Introduce IndirectionExpr and support for array subscripting #10669
sql/parser: Introduce IndirectionExpr and support for array subscripting #10669
Conversation
Reviewed 4 of 4 files at r1, 10 of 10 files at r2. pkg/sql/pgwire_test.go, line 281 at r2 (raw file):
Please add a test that demonstrates when the placeholder at this syntax position can be properly typed. pkg/sql/parser/eval.go, line 1908 at r2 (raw file):
Even though the rest of the code is not ready I think you can remove this condition here -- the Eval code is pretty much OK as it is for when the rest of the machinery supports multi-dimensional arrays. (There is perhaps a case to be made that we could compute a global index from a multi-dimensional index, assuming the array is homogeneous, but if that's what we want to do then the condition must be before the loop -- pkg/sql/parser/eval.go, line 1920 at r2 (raw file):
Perhaps more informative "syntax not yet supported: %s", expr.Indirection? pkg/sql/parser/parse_test.go, line 304 at r2 (raw file):
Why not also pkg/sql/parser/type_check.go, line 234 at r2 (raw file):
See above - I think you're doing fine without this check. pkg/sql/parser/type_check.go, line 243 at r2 (raw file):
See above - "syntax not yet supported" Comments from Reviewable |
a3fd203
to
44fcf42
Compare
Review status: 6 of 11 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. pkg/sql/pgwire_test.go, line 281 at r2 (raw file):
|
44fcf42
to
504ec9e
Compare
Reviewed 10 of 10 files at r4. pkg/sql/pgwire_test.go, line 281 at r2 (raw file):
|
This change adds support for subscripting ARRAY expressions by introducing an
IndirectionExpr
node. This is the same approach that Postgres uses to represent indirection in its AST.This change is