[ASTERIXDB-2394][COMP] Align VarCounter in query rewritting - user model changes: no - storage format changes: no - interface changes: no
Details: Currently, before we do certain language rewritings, we take a snapshot of the var counter in the context and pass it to the rewriter. This works fine in most of the cases, but it can fail when the rewriter introduces new variables. This will cause different variables map to the same variable id. Although this error may be fixed by another ScopingVisitor, the compiler could fail if there is no more visitor down in the rewriting workflow.
[ASTERIXDB-2170][SQL] Fix resolution order of implicit field access - user model changes: yes - storage format changes: no - interface changes: no
Details: - Improved name resolution rules - Resolve field access to the nearest variable in scope instead of raising compile-time error - Do not rely on type information when resolving names - Cleanup group variable handling in GroupBy clause, no longer use ‘with’ map for it - Fix ByNameToByIndexFieldAccessRule to use type environment of its input operator when analyzing its expression - Fix ExternalGroupByPOperator to use input schema of its aggregate function when generating runtime for that function - Fix invalid free variable computation for GroupBy clause