Add ClickHouse platform support (wayang-clickhouse)
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, databases, distributed-systems
Hướng nghiên cứu
Start by comparing wayang-trino, wayang-presto and wayang-bigquery with the shared classes in wayang-jdbc-template; the issue proposes mirroring their module structure. Work is divided into five sequential PRs, beginning with the module skeleton and SQL generation tests. Done means implementing the scoped operators, mappings, tests and documentation, including a ClickHouse sink engine clause; first confirm the three open design questions with maintainers.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Wayang supports several JDBC-backed platforms (PostgreSQL, SQLite3, generic JDBC, Trino, Presto, BigQuery) through wayang-jdbc-template, but has no ClickHouse platform. ClickHouse is a widely used column-oriented OLAP engine, and Wayang's SQL pushdown (filter, projection, join, aggregation, sort, table sink) suits it well.
I propose adding a wayang-platforms/wayang-clickhouse module that follows the structure of wayang-trino / wayang-presto / wayang-bigquery (all seven template operators, README, integration tests), rather than the smaller wayang-postgres module.
Proposed module layout
| Component | Class / file | Notes |
|---|---|---|
| Entry point | ClickHouse.java |
plugin(), conversionPlugin(), platform() |
| Platform | ClickHousePlatform extends JdbcPlatformTemplate |
name ClickHouse, config id clickhouse, official com.clickhouse:clickhouse-jdbc driver (Apache 2.0) |
| Operators | ClickHouse{TableSource,Filter,Projection,Join,GlobalReduce,ReduceBy,Sort,TableSink}Operator |
extend the existing Jdbc* base classes |
| Mappings | one per operator + Mappings.ALL |
same as Trino |
| Channels | ChannelConversions |
SQL -> Java stream, SQL -> Spark RDD |
| Plugins | ClickHousePlugin, ClickHouseConversionsPlugin |
used via .withPlugin(ClickHouse.plugin()) |
| Config | wayang-clickhouse-defaults.properties |
wayang.clickhouse.jdbc.{url,user,password}, cost parameters |
| Build | wayang-platforms/pom.xml |
new <module> |
ClickHouse-specific points
The generic SQL built in JdbcExecutor.createSqlString (SELECT ... FROM ... JOIN ... ON ... WHERE ... GROUP BY ... ORDER BY, no trailing ;) is valid ClickHouse SQL, so no changes to wayang-jdbc-template are planned. The dialect-specific work is:
- Table sink engine.
JdbcTableSinkOperatoremitsCREATE TABLE <t> AS <select>inoverwritemode. ClickHouse needs an engine for this, e.g.CREATE TABLE <t> ENGINE = MergeTree ORDER BY tuple() AS SELECT .... Since the engine clause must come beforeAS,ClickHouseTableSinkOperatorwould overridecreateSqlClause, with a configurable engine (e.g.wayang.clickhouse.tablesink.engine, defaultMergeTree ORDER BY tuple()).INSERT INTO <t> SELECT ...andDROP TABLE IF EXISTSwork unchanged. - Identifier quoting.
SqlIdentifierUtils.escapeAndQuoteIdentifierreads the quote character and case folding fromDatabaseMetaData. ClickHouse identifiers are case-sensitive; tests will coverdatabase.tablenames. - Type mapping.
SqlToStreamOperatorusesResultSet.getObject, so ClickHouse types such asUInt64(BigInteger),Date/DateTime,Nullable(T)andLowCardinality(String)appear as-is inRecords. I will document the mapping and test the common types. - Joins and NULLs. ClickHouse builds the hash table from the right side of a join, and columns are non-nullable by default (
join_use_nulls = 0). Behaviour will be documented; no changes to the join SQL are planned.
Testing plan
- Unit tests for the generated ClickHouse SQL (sink with engine clause, quoting) that need no server.
ClickHouseOperatorsITmodelled onTrinoOperatorsIT: covers all seven operators, creates and drops its own fixture tables, and is skipped (not failed) when no server is reachable (CLICKHOUSE_HOST/CLICKHOUSE_PORT).- No docker-compose or setup folders in the source tree, per #796.
Documentation and examples
wayang-platforms/wayang-clickhouse/README.mdClickHouseDemoinwayang-applicationspluswayang-applications/clickhouse.md- Add ClickHouse to the platform list in
wayang-docs/src/main/resources/index.md
Out of scope (possible follow-ups)
- Measured cost-model parameters (initial values will be uncalibrated, as in
wayang-postgres); aClickHouseCostPilotITfollowingguides/cost-profiling.mdcan follow. - Registering ClickHouse in
SqlContext,JsonPlanBuilder, orMultiContextDeserializer, which currently hard-code Postgres/SQLite. - Native (non-JDBC) protocol and ClickHouse-specific functions beyond pass-through SQL predicates.
Proposed PR sequence
To keep reviews small, I'd split this into sequential PRs. Each one builds and passes tests on its own.
| PR | Scope | Depends on |
|---|---|---|
| 1 | Module skeleton: pom.xml, ClickHousePlatform, ClickHouse entry point, ClickHouseExecutionOperator, ClickHouseTableSource, channel conversions, plugins, defaults properties, filter + projection mappings, SQL-generation unit tests, register in wayang-platforms/pom.xml |
- |
| 2 | Join, GlobalReduce, ReduceBy and Sort operators + mappings, ClickHouseOperatorsIT (skipped without a server) |
PR 1 |
| 3 | ClickHouseTableSinkOperator with configurable ENGINE clause, sink tests |
PR 1 |
| 4 | Module README, ClickHouseDemo + clickhouse.md in wayang-applications, docs index entry |
PRs 1-3 |
| 5 (optional) | Cost calibration via ClickHouseCostPilotIT and measured defaults |
PRs 1-3 |
PRs that depend on an earlier one will be opened as drafts marked "Depends on #X" and rebased after it merges.
Questions for maintainers
- Is the Trino/Presto/BigQuery module structure the preferred reference for a new SQL platform?
- Is a configurable sink engine acceptable, or should the sink only support
INSERT INTOinto pre-created tables? - Are integration tests that skip when no server is available acceptable for CI, or is a Testcontainers-based test preferred?
I'd like to work on this and will open a PR once the approach is agreed.
- Ngôn ngữ chính
- Java
- Star
- 284
- Fork
- 143
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/wayang
-
JavaReservoirSampleOperator returns the whole input when the dataset size is unknownCó thể đã có người làm @sasmith-14 đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/wayang#884 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Record.compareTo() throws ClassCastException when comparing recordsCó thể đã có người làm @harshitsingh070 đã nhận 64 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Unused parameter in function ProjectionDescriptor.createPojoJavaImplementation()Có thể đã có người làm @AliRana30 đã nhận 72 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/wayang#732 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[PyWayang] Implement load_collection() and collect()Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/wayang
Issue tương tự
-
area-templates triage:bot-seen triage:needs-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/aspire#22356 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/flink-agents#1395 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
floci-io/floci#8666 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
microsoft/kiota-java#2257 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openhab/openhab-core#5992 ·
Maintainer thường phản hồi trong vòng 1 ngày