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

Support Query ClickHouse AggregatingMergeTree Engine Table. #53950

Open
FayeSpica opened this issue Dec 15, 2024 · 0 comments
Open

Support Query ClickHouse AggregatingMergeTree Engine Table. #53950

FayeSpica opened this issue Dec 15, 2024 · 0 comments
Labels
type/enhancement Make an enhancement to StarRocks

Comments

@FayeSpica
Copy link

FayeSpica commented Dec 15, 2024

Enhancement

StarRocks as Query Engine

Our team is trying to use StarRocks as a unified query engine layer. We are encountering issues when querying materialized views in ClickHouse.

e.g.

ClickHouse

CREATE DATABASE db0;
CREATE TABLE db0.simple (id UInt64, val SimpleAggregateFunction(sum, UInt64)) ENGINE=AggregatingMergeTree() ORDER BY id;
INSERT INTO db0.simple(id, val) VALUES (1, 10),(1, 11),(2, 12);

Expected Result

ClickHouse :) select id, sum(val) from db0.simple GROUP BY id;

SELECT
    id,
    sum(val)
FROM db0.simple
GROUP BY id

Query id: da27ce92-1f98-4790-9a3d-00f5e9d72b03

   ┌─id─┬─sum(val)─┐
1. │  2 │       12 │
2. │  1 │       21 │
   └────┴──────────┘

2 rows in set. Elapsed: 0.004 sec.

StarRocks

CREATE EXTERNAL CATALOG clickhouse
COMMENT 'example'
PROPERTIES
(
    "type"="jdbc", 
    "user"="default",
    "password"="",
    "jdbc_uri"="jdbc:clickhouse:[your ClickHouse address]:8123",
    "driver_url"="file:///[url]/clickhouse-jdbc-0.7.1-all.jar",
    "driver_class"="com.clickhouse.jdbc.ClickHouseDriver"
);

Query ClickHouse table from StarRocks

SELECT id, sum(val) FROM clickhouse.db0.simple GROUP BY id;

Got Error:

ERROR 1064 (HY000): Getting analyzing error. Detail message: Datatype of external table column [val] is not supported!.

Features Required

  1. Support AggregateFuntion types
  2. Support Aggregation pushdown
@FayeSpica FayeSpica added the type/enhancement Make an enhancement to StarRocks label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Make an enhancement to StarRocks
Projects
None yet
Development

No branches or pull requests

1 participant