mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #58335 from lingtaolf/feature/sparkBar_alias_to_sparkbar
sparkBar as an alias to sparkbar
This commit is contained in:
commit
09181b6c37
@ -60,3 +60,5 @@ Result:
|
|||||||
└──────────────────────────────────────────────────────────────────────────┘
|
└──────────────────────────────────────────────────────────────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The alias for this function is sparkBar.
|
||||||
|
|
||||||
|
@ -378,6 +378,7 @@ AggregateFunctionPtr createAggregateFunctionSparkbar(const std::string & name, c
|
|||||||
void registerAggregateFunctionSparkbar(AggregateFunctionFactory & factory)
|
void registerAggregateFunctionSparkbar(AggregateFunctionFactory & factory)
|
||||||
{
|
{
|
||||||
factory.registerFunction("sparkbar", createAggregateFunctionSparkbar);
|
factory.registerFunction("sparkbar", createAggregateFunctionSparkbar);
|
||||||
|
factory.registerAlias("sparkBar", "sparkbar");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
▂▅▂▃▆█ ▂
|
||||||
|
▂▅▂▃▆█ ▂
|
12
tests/queries/0_stateless/02955_sparkBar_alias_sparkbar.sql
Normal file
12
tests/queries/0_stateless/02955_sparkBar_alias_sparkbar.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
SET allow_experimental_analyzer = 1;
|
||||||
|
DROP TABLE IF EXISTS spark_bar_test;
|
||||||
|
|
||||||
|
CREATE TABLE spark_bar_test (`value` Int64, `event_date` Date) ENGINE = MergeTree ORDER BY event_date;
|
||||||
|
|
||||||
|
INSERT INTO spark_bar_test VALUES (1,'2020-01-01'), (3,'2020-01-02'), (4,'2020-01-02'), (-3,'2020-01-02'), (5,'2020-01-03'), (2,'2020-01-04'), (3,'2020-01-05'), (7,'2020-01-06'), (6,'2020-01-07'), (8,'2020-01-08'), (2,'2020-01-11');
|
||||||
|
|
||||||
|
SELECT sparkbar(9)(event_date,cnt) FROM (SELECT sum(value) as cnt, event_date FROM spark_bar_test GROUP BY event_date);
|
||||||
|
SELECT sparkBar(9)(event_date,cnt) FROM (SELECT sum(value) as cnt, event_date FROM spark_bar_test GROUP BY event_date);
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS spark_bar_test;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user