-- 13aggregate 目录初始化:聚合操作测试 -- 创建用于聚合测试的 class create class if not exists /test/aaa/test_aggr ( a_name varchar, a_category varchar, a_int int, a_bigint bigint, a_float float, a_double double, a_amount int, a_bool bool, indexes(a_name, a_category, a_int, a_amount, a_float, a_double, a_bool), keys(a_name) ) with core=cassandraonly ; -- 插入聚合测试数据 insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_001', 'category_a', 10, 100, 10.5, 100.5, true) ; insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_002', 'category_a', 20, 200, 20.5, 200.5, false) ; insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_003', 'category_b', 30, 300, 30.5, 300.5, true) ; insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_004', 'category_b', 40, 400, 40.5, 400.5, false) ; insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_005', 'category_c', 50, 500, 50.5, 500.5, true) ; insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_006', 'category_a', 10, 150, 15.5, 150.5, true) ; insert into /test/aaa/test_aggr (a_name, a_category, a_int, a_amount, a_float, a_double, a_bool) values ('aggr_007', 'category_b', 30, 350, 35.5, 350.5, false) ; -- 等待数据写入完成 /** sleep(1s) **/ ;