Description
The ESQL telemetry infrastructure expects each LogicalPlan to map uniquely to a command, (through LogicalPlan#commandName()) an assumption that can't be generalized.
Instead the mapping between the plan and the commands needs to be moved to a separate class / registry / map.
P.S. Furthermore, the telemetry might in time be moved to occur at parsing time to track queries that don't pass the grammar, before the logical AST is fully assembled.
Example: FROM index | INLINESTATS c = count() should count FROM and INLINESTATS but ends up counting FROM, INLINESTATS and STATS (due to the normalized plan).
Description
The ESQL telemetry infrastructure expects each LogicalPlan to map uniquely to a command, (through LogicalPlan#commandName()) an assumption that can't be generalized.
Instead the mapping between the plan and the commands needs to be moved to a separate class / registry / map.
P.S. Furthermore, the telemetry might in time be moved to occur at parsing time to track queries that don't pass the grammar, before the logical AST is fully assembled.
Example:
FROM index | INLINESTATS c = count()should count FROM and INLINESTATS but ends up counting FROM, INLINESTATS and STATS (due to the normalized plan).