Comments (1)
hi, wanted to create issue with sampling and array join, but I believe it would be a duplicate of this issue..
I'm using clickhouse-sqlalchemy==0.1.8
and
from sqlalchemy.sql.ddl import CreateTable
from clickhouse_sqlalchemy import engines, types, get_declarative_base, make_session
from sqlalchemy import create_engine, MetaData, Column
from clickhouse_sqlalchemy.drivers.base import ClickHouseDialect, clickhouse_dialect
uri = 'clickhouse+native://default:default@clickhouse:9000'
engine = create_engine(uri)
session = make_session(engine)
metadata = MetaData(bind=engine)
Base = get_declarative_base(metadata=metadata)
class Table(Base):
id = Column(types.UInt32(), primary_key=True)
arr = Column(types.Array(types.String))
__table_args__ = (
engines.MergeTree(
order_by="id",
sample_by="id",
),
)
# print(CreateTable(Table.__table__).compile(dialect=clickhouse_dialect))
q = session.query(Table.arr).sample(0.2).array_join(Table.arr)
print(q.statement.compile(dialect=clickhouse_dialect))
was producing
SELECT "table".arr
FROM "table"
ARRAY JOIN "table".arr
SAMPLE %(param_1)s
instead of
SELECT "table".arr
FROM "table"
SAMPLE %(param_1)s
ARRAY JOIN "table".arr
when wanted to check it with latest 0.2.2
I got
SELECT "table".arr
FROM "table"
with no ARRAY JOIN
nor SAMPLE
.
- what am I doing wrong?
- is sampling supported when using array join?
from clickhouse-sqlalchemy.
Related Issues (20)
- Does `clickhouse-sqlalchemy` 3.0.0 support `sqlalchemy` of the version 1.4.*? HOT 5
- Create a cluster table orm class with engines.Distributed which has a logs attribute, how to use variable to indicate it?
- alembic does not autogenerate engine for clickhouse table HOT 4
- Patreon does not work HOT 1
- Add support for Date32 HOT 2
- Handling Clickhouse Alembic Migrations for Clickhouse cluster HOT 2
- Support/example for creating views HOT 2
- `create_all` for all the `MaterializedView`
- With chdb this clickhouse downsized memory database, can clickhouse-sqlalchemy support it or not?
- Support VariantType
- Table reflection for DateTime64 timezone will be extra quoted
- Alembic_Version Records disappered after clickhouse alembic migration HOT 5
- using http mode, connecting database failed when account password ends with @ HOT 2
- Support nested Map column
- Cannot seem to run ALTER command on replicas of the same shard HOT 2
- Sqlalchemy can't catch asynch's error
- query_id cannot be set with the native TCP connection
- Feature Request: Support clickhouse-connect's NEW AsyncClient wrapper HOT 5
- Nested maps, tuples, enums don't work HOT 2
- Support Lightweight DELETE Statement HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse-sqlalchemy.