@@ -123,8 +123,8 @@ bool GetUpdatedResult(const uint32_t& id, const std::string& aggr_col, const std
123123 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
124124 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
125125 replicator->Init ();
126- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , aggr_col, aggr_type ,
127- " ts_col" , bucket_size, " low_card" );
126+ auto aggr = CreateAggregator (base_table_meta, table, aggr_table_meta, aggr_table, replicator, 0 ,
127+ aggr_col, aggr_type, " ts_col" , bucket_size, " low_card" );
128128 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
129129 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
130130 base_replicator->Init ();
@@ -319,7 +319,8 @@ void CheckCountWhereAggrResult(std::shared_ptr<Table> aggr_table, std::shared_pt
319319TEST_F (AggregatorTest, CreateAggregator) {
320320 // rows_num window type
321321 std::map<std::string, std::string> map;
322- std::string folder = " /tmp/" + GenRand () + " /" ;
322+ ::openmldb::test::TempPath tmp_path;
323+ std::string folder = tmp_path.GetTempPath ();
323324 {
324325 uint32_t id = counter++;
325326 ::openmldb::api::TableMeta base_table_meta;
@@ -334,8 +335,8 @@ TEST_F(AggregatorTest, CreateAggregator) {
334335 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
335336 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
336337 replicator->Init ();
337- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " sum " ,
338- " ts_col" , " 1000" );
338+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
339+ " col3 " , " sum " , " ts_col" , " 1000" );
339340 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
340341 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
341342 base_replicator->Init ();
@@ -360,8 +361,8 @@ TEST_F(AggregatorTest, CreateAggregator) {
360361 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
361362 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
362363 replicator->Init ();
363- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " sum " ,
364- " ts_col" , " 1d" );
364+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
365+ " col3 " , " sum " , " ts_col" , " 1d" );
365366 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
366367 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
367368 base_replicator->Init ();
@@ -385,8 +386,8 @@ TEST_F(AggregatorTest, CreateAggregator) {
385386 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
386387 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
387388 replicator->Init ();
388- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " sum " ,
389- " ts_col" , " 2s" );
389+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
390+ " col3 " , " sum " , " ts_col" , " 2s" );
390391 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
391392 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
392393 base_replicator->Init ();
@@ -410,8 +411,8 @@ TEST_F(AggregatorTest, CreateAggregator) {
410411 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
411412 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
412413 replicator->Init ();
413- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " sum " ,
414- " ts_col" , " 3m" );
414+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
415+ " col3 " , " sum " , " ts_col" , " 3m" );
415416 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
416417 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
417418 base_replicator->Init ();
@@ -435,8 +436,8 @@ TEST_F(AggregatorTest, CreateAggregator) {
435436 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
436437 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
437438 replicator->Init ();
438- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " sum " ,
439- " ts_col" , " 100h" );
439+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
440+ " col3 " , " sum " , " ts_col" , " 100h" );
440441 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
441442 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
442443 base_replicator->Init ();
@@ -471,7 +472,8 @@ TEST_F(AggregatorTest, SumAggregatorUpdate) {
471472 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
472473 replicator->Init ();
473474 auto aggr =
474- CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3" , " sum" , " ts_col" , " 2" );
475+ CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
476+ " col3" , " sum" , " ts_col" , " 2" );
475477 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
476478 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
477479 base_replicator->Init ();
@@ -739,7 +741,8 @@ TEST_F(AggregatorTest, OutOfOrder) {
739741 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
740742 replicator->Init ();
741743 auto aggr =
742- CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3" , " sum" , " ts_col" , " 1s" );
744+ CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
745+ " col3" , " sum" , " ts_col" , " 1s" );
743746 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
744747 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
745748 base_replicator->Init ();
@@ -808,7 +811,8 @@ TEST_F(AggregatorTest, OutOfOrder) {
808811
809812TEST_F (AggregatorTest, OutOfOrderCountWhere) {
810813 std::map<std::string, std::string> map;
811- std::string folder = " /tmp/" + GenRand () + " /" ;
814+ ::openmldb::test::TempPath tmp_path;
815+ std::string folder = tmp_path.GetTempPath ();
812816 uint32_t id = counter++;
813817 ::openmldb::api::TableMeta base_table_meta;
814818 base_table_meta.set_tid (id);
@@ -822,8 +826,8 @@ TEST_F(AggregatorTest, OutOfOrderCountWhere) {
822826 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
823827 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
824828 replicator->Init ();
825- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " count_where " ,
826- " ts_col" , " 1s" , " low_card" );
829+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
830+ " col3 " , " count_where " , " ts_col" , " 1s" , " low_card" );
827831 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
828832 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
829833 base_replicator->Init ();
@@ -914,7 +918,8 @@ TEST_F(AggregatorTest, OutOfOrderCountWhere) {
914918
915919TEST_F (AggregatorTest, AlignedCountWhere) {
916920 std::map<std::string, std::string> map;
917- std::string folder = " /tmp/" + GenRand () + " /" ;
921+ ::openmldb::test::TempPath tmp_path;
922+ std::string folder = tmp_path.GetTempPath ();
918923 uint32_t id = counter++;
919924 ::openmldb::api::TableMeta base_table_meta;
920925 base_table_meta.set_tid (id);
@@ -928,8 +933,8 @@ TEST_F(AggregatorTest, AlignedCountWhere) {
928933 std::shared_ptr<LogReplicator> replicator = std::make_shared<LogReplicator>(
929934 aggr_table->GetId (), aggr_table->GetPid (), folder, map, ::openmldb::replica::kLeaderNode );
930935 replicator->Init ();
931- auto aggr = CreateAggregator (base_table_meta, aggr_table_meta, aggr_table, replicator, 0 , " col3 " , " count_where " ,
932- " ts_col" , " 1s" , " low_card" );
936+ auto aggr = CreateAggregator (base_table_meta, nullptr , aggr_table_meta, aggr_table, replicator, 0 ,
937+ " col3 " , " count_where " , " ts_col" , " 1s" , " low_card" );
933938 std::shared_ptr<LogReplicator> base_replicator = std::make_shared<LogReplicator>(
934939 base_table_meta.tid (), base_table_meta.pid (), folder, map, ::openmldb::replica::kLeaderNode );
935940 base_replicator->Init ();
0 commit comments