Skip to content

Commit f0c061e

Browse files
add case
1 parent 949359b commit f0c061e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- This file is automatically generated. You should know what you did if you want to edit this
2+
-- !ctas --
3+
135.55 67.7750
4+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
suite("avg_distinct_to_sum_div_count") {
19+
sql "drop table if exists t1;"
20+
sql """ create table t1 (
21+
pk int,
22+
c1 decimal(12,2) not null)
23+
properties("replication_num" = "1");"""
24+
25+
sql "insert into t1 values(1,12.32),(2,123.23);"
26+
sql "drop table if exists testctas;"
27+
sql """create table testctas properties("replication_num" = "1") select sum(distinct c1),avg(distinct c1) from t1;"""
28+
qt_ctas "select * from testctas;"
29+
}

0 commit comments

Comments
 (0)