Skip to content

Conversation

@vgvoleg
Copy link
Contributor

@vgvoleg vgvoleg commented Dec 23, 2025

Resolves: #6626

@vgvoleg vgvoleg marked this pull request as draft December 23, 2025 19:58
@vgvoleg vgvoleg force-pushed the dialect_plugins_feature branch from e75a6a8 to ed45e5f Compare December 23, 2025 20:01
@georgesittas
Copy link
Collaborator

Drop a ping / bump this PR when ready.

@vgvoleg vgvoleg force-pushed the dialect_plugins_feature branch from ed45e5f to 85acb55 Compare December 23, 2025 20:20
@vgvoleg vgvoleg marked this pull request as ready for review December 23, 2025 20:25
@vgvoleg vgvoleg requested a review from georgesittas December 23, 2025 20:34
Copy link
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

Great work, thanks for your contribution. A few questions on my end, @tobymao you may wanna take a look at this one too.

@georgesittas georgesittas changed the title Ability to create dialect plugins Feat: add ability to create dialect plugins Dec 24, 2025
@vgvoleg vgvoleg force-pushed the dialect_plugins_feature branch from 85acb55 to a4e1d16 Compare December 24, 2025 10:21
@vgvoleg
Copy link
Contributor Author

vgvoleg commented Dec 24, 2025

@georgesittas @tobymao

So there's a proof-of-concept plugin:
https://github.com/ydb-platform/ydb-sqlglot-plugin

There's entrypoints definition:
https://github.com/ydb-platform/ydb-sqlglot-plugin/blob/197203f4ef1c7ffc0d4dbe7e7c9ba6bc104c71f2/pyproject.toml#L39-L40

You can install it from github
pip install git+https://github.com/ydb-platform/ydb-sqlglot-plugin.git

And check (before and after installation) this script:

import sqlglot

query = """
with cte as (select * from b) select * from a, cte where nvl(b)>0 and EXTRACT(YEAR FROM dt) > 2024
"""

print(sqlglot.transpile(query, read="postgres", write="ydb"))

@vgvoleg vgvoleg requested a review from georgesittas December 24, 2025 10:27
@georgesittas georgesittas merged commit c17878a into tobymao:main Dec 29, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin Support via Entry Points

2 participants