[
https://issues.apache.org/jira/browse/CALCITE-6574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17881400#comment-17881400
]
Julian Hyde commented on CALCITE-6574:
--------------------------------------
I wonder whether those helper functions truly need to be part of
{{SqlValidator}}. For example, I don't know whether
{{SqlValidator.isAggregate(SqlSelect)}} is typical, but it uses things like
{{catalogReader}} and {{overFinder}} and (via {{getAgg}}) {{clauseScopes}}, and
all those things could all be available in a scope-map-under-construction.
Identifying and cutting those tendrils that have grown between two pieces of
code is not easy work but it is the valuable work. And sometimes the conclusion
is that these two pieces of code are better left in one piece.
I am very interested what those helper functions are. The main work of the
validator is resolving identifiers and deriving types; due to the design of the
SQL language (especially correlating variables) that cannot be done top-down or
bottom-up but requires a dynamic programming approach. Creating the tree of
scopes and namespaces should be a separable earlier phase. Determining what
kind of scopes these are (e.g. whether a query is an aggregate query) requires
a little bit of name resolution and so creates a gray area. I would love your
analysis of what is in that gray area.
> Add ScopeMap
> ------------
>
> Key: CALCITE-6574
> URL: https://issues.apache.org/jira/browse/CALCITE-6574
> Project: Calcite
> Issue Type: Sub-task
> Reporter: James Starr
> Assignee: James Starr
> Priority: Major
> Labels: pull-request-available
>
> See parent description.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)