From 6303c8d538fcf8c06d32978337b632e0f2224177 Mon Sep 17 00:00:00 2001 From: DualFroz Date: Fri, 4 Sep 2026 16:42:47 +0200 Subject: [PATCH] feat(parser): expand Parser --- src/main/kotlin/kestrel/sql/parser/Parser.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/kotlin/kestrel/sql/parser/Parser.kt b/src/main/kotlin/kestrel/sql/parser/Parser.kt index 99336a5..f20a2cf 100644 --- a/src/main/kotlin/kestrel/sql/parser/Parser.kt +++ b/src/main/kotlin/kestrel/sql/parser/Parser.kt @@ -1805,4 +1805,20 @@ class Parser(private val tokens: List) { 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 + ) + } }