feat(parser): expand Parser
This commit is contained in:
1 parent
7a2c8037e2
commit
6303c8d538
1 file changed
+16
@@ -1805,4 +1805,20 @@ class Parser(private val tokens: List<Token>) {
|
||||
|
||||
private fun describe(token: Token): String =
|
||||
if (token.type == TokenType.EndOfInput) "end of input" else token.lexeme
|
||||
|
||||
private companion object {
|
||||
val AGGREGATE_FUNCTIONS = setOf("COUNT", "SUM", "AVG", "MIN", "MAX")
|
||||
val WINDOW_RANKING_FUNCTIONS = mapOf(
|
||||
"ROW_NUMBER" to WindowFunctionKind.RowNumber,
|
||||
"RANK" to WindowFunctionKind.Rank,
|
||||
"DENSE_RANK" to WindowFunctionKind.DenseRank
|
||||
)
|
||||
val WINDOW_OTHER_FUNCTIONS = mapOf(
|
||||
"LAG" to WindowFunctionKind.Lag,
|
||||
"LEAD" to WindowFunctionKind.Lead,
|
||||
"FIRST_VALUE" to WindowFunctionKind.FirstValue,
|
||||
"LAST_VALUE" to WindowFunctionKind.LastValue,
|
||||
"NTILE" to WindowFunctionKind.Ntile
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user