Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres: Add window function support #4283

Merged
merged 21 commits into from
Jun 27, 2023
Merged

Postgres: Add window function support #4283

merged 21 commits into from
Jun 27, 2023

Conversation

hfhbd
Copy link
Collaborator

@hfhbd hfhbd commented Jun 16, 2023

Fixes AlecKazakova/sql-psi#313

Instead overwriting the whole select and functions expr, I used AlecKazakova/sql-psi#517 to add the new window function expr.

@hfhbd hfhbd marked this pull request as draft June 16, 2023 07:49
@hfhbd
Copy link
Collaborator Author

hfhbd commented Jun 16, 2023

Draft because it needs a new (SNAPSHOT) release after AlecKazakova/sql-psi#517

@AlecKazakova
Copy link
Collaborator

same thing for this one, what probably makes the most sense is to target one of the other PRs based on sql-psi:0.4.5 so it doesn't have to go through CI checks a second time after it merges

@hfhbd hfhbd changed the base branch from master to hfhbd/long-version June 27, 2023 11:56
Base automatically changed from hfhbd/long-version to master June 27, 2023 12:01
@hfhbd hfhbd enabled auto-merge (squash) June 27, 2023 12:04
@hfhbd hfhbd disabled auto-merge June 27, 2023 12:04
@hfhbd hfhbd enabled auto-merge (squash) June 27, 2023 12:05
@@ -141,6 +155,13 @@ class PostgreSqlTypeResolver(private val parentResolver: TypeResolver) : TypeRes
literalValue.text.startsWith("INTERVAL") -> IntermediateType(PostgreSqlType.INTERVAL)
else -> parentResolver.resolvedType(this)
}
is PostgreSqlExtensionExpr -> when {
windowFunctionExpr != null -> {
val windowFunctionExpr = windowFunctionExpr as WindowFunctionMixin
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this works with the typo in PostgreSql.bnf

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or this code is never executed because we don't try to generate types based on the window function in tests anywhere

Copy link
Collaborator Author

@hfhbd hfhbd Jun 27, 2023