Closed danlyons-home closed 7 months ago
For my immediate purposes, I switched pivot_element
locally to the following:
pivot_element
--- : aggregate_function_name '(' expression ')' column_alias?
+++ : numeric_function column_alias?
;
but I'm not sure that's quite correct.
I ran into some parse failures with a query including a
PIVOT
usingCOUNT(*)
. I can reproduce it with the following simplistic query against v$session:For reference: Oracle pivot_clause documentation
The current parser definition for
pivot_element
is as follows: https://github.com/antlr/grammars-v4/blob/d939aad7310b6a214d6ade30afc90eb28f9fe809/sql/plsql/PlSqlParser.g4#L5735-L5737At a glance, it looks like it should work with
COUNT(*)
, but it fails with the following: Exception:Message:
mismatched input '(' expecting {<EOF>, '/', ';'}
Offending Symbol:mismatched input '(' expecting {<EOF>, '/', ';'}
Line: 11 Character Position: 0