xzkostyan / clickhouse-sqlalchemy

ClickHouse dialect for SQLAlchemy
https://clickhouse-sqlalchemy.readthedocs.io
Other
418 stars 121 forks source link

"global in" support? #113

Open david-hfx opened 3 years ago

david-hfx commented 3 years ago

I am very happy to see the support of "global join". Does it support "global in" now? How does it work?

xzkostyan commented 3 years ago

GLOBAL IN is not supported yet.

david-hfx commented 3 years ago

Thanks for the reply. I want to know if this feature is planned and when it will be available. Because I feel that this function is quite common.

xzkostyan commented 3 years ago

Currently there is no ETA for this feature. But it's not so hard to implement it. See how it's customized in sqlalchemy.dialects.mssql.base.MSSQLStrictCompiler.visit_in_op_binary.

I'd do the follwing steps for adding it's support:

david-hfx commented 3 years ago

Thanks! This is quite useful for me.

Simon-Chenzw commented 2 months ago

just use column.op("GLOBAL IN", return_type=sa.Boolean)(subquery) this works well for me

docs: https://docs.sqlalchemy.org/en/20/core/sqlelement.html#sqlalchemy.sql.expression.Operators.op https://docs.sqlalchemy.org/en/20/core/sqlelement.html#sqlalchemy.sql.expression.custom_op