github-advanced-security[bot] commented on code in PR #18021:
URL: https://github.com/apache/druid/pull/18021#discussion_r2212418471


##########
extensions-contrib/druid-exact-count-bitmap/src/test/java/org/apache/druid/query/aggregation/exact/count/bitmap64/sql/Bitmap64ExactCountSqlAggregatorTest.java:
##########
@@ -0,0 +1,244 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.exact.count.bitmap64.sql;
+
+import com.google.common.collect.ImmutableList;
+import org.apache.druid.error.DruidException;
+import org.apache.druid.initialization.DruidModule;
+import org.apache.druid.java.util.common.granularity.Granularities;
+import org.apache.druid.query.Druids;
+import 
org.apache.druid.query.aggregation.exact.count.bitmap64.Bitmap64ExactCountBuildAggregatorFactory;
+import 
org.apache.druid.query.aggregation.exact.count.bitmap64.Bitmap64ExactCountMergeAggregatorFactory;
+import 
org.apache.druid.query.aggregation.exact.count.bitmap64.Bitmap64ExactCountModule;
+import 
org.apache.druid.query.aggregation.hyperloglog.HyperUniquesAggregatorFactory;
+import org.apache.druid.query.dimension.DefaultDimensionSpec;
+import org.apache.druid.query.groupby.GroupByQuery;
+import org.apache.druid.query.spec.MultipleIntervalSegmentSpec;
+import org.apache.druid.segment.IndexBuilder;
+import org.apache.druid.segment.QueryableIndex;
+import org.apache.druid.segment.column.ColumnType;
+import org.apache.druid.segment.incremental.IncrementalIndexSchema;
+import 
org.apache.druid.segment.writeout.OffHeapMemorySegmentWriteOutMediumFactory;
+import org.apache.druid.server.SpecificSegmentsQuerySegmentWalker;
+import org.apache.druid.sql.calcite.BaseCalciteQueryTest;
+import org.apache.druid.sql.calcite.SqlTestFrameworkConfig;
+import org.apache.druid.sql.calcite.TempDirProducer;
+import org.apache.druid.sql.calcite.filtration.Filtration;
+import org.apache.druid.sql.calcite.util.CalciteTests;
+import org.apache.druid.sql.calcite.util.DruidModuleCollection;
+import 
org.apache.druid.sql.calcite.util.SqlTestFramework.StandardComponentSupplier;
+import org.apache.druid.sql.calcite.util.TestDataBuilder;
+import org.apache.druid.sql.calcite.util.datasets.TestDataSet;
+import org.apache.druid.timeline.DataSegment;
+import org.apache.druid.timeline.partition.LinearShardSpec;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collections;
+
[email protected](Bitmap64ExactCountSqlAggregatorTest.Bitmap64ExactCountSqlAggComponentSupplier.class)
+public class Bitmap64ExactCountSqlAggregatorTest extends BaseCalciteQueryTest
+{
+  private static final String DATA_SOURCE = "numfoo";
+
+  public static class Bitmap64ExactCountSqlAggComponentSupplier extends 
StandardComponentSupplier
+  {
+    public Bitmap64ExactCountSqlAggComponentSupplier(TempDirProducer 
tempFolderProducer)
+    {
+      super(tempFolderProducer);
+    }
+
+    @Override
+    public DruidModule getCoreModule()
+    {
+      return DruidModuleCollection.of(super.getCoreModule(), new 
Bitmap64ExactCountModule());
+    }
+
+    @Override
+    public SpecificSegmentsQuerySegmentWalker 
addSegmentsToWalker(SpecificSegmentsQuerySegmentWalker walker)
+    {
+      Bitmap64ExactCountModule.registerSerde();
+      final QueryableIndex index =
+          IndexBuilder.create(CalciteTests.getJsonMapper())
+                      .tmpDir(tempDirProducer.newTempFolder())
+                      
.segmentWriteOutMediumFactory(OffHeapMemorySegmentWriteOutMediumFactory.instance())
+                      .schema(
+                          IncrementalIndexSchema.builder()
+                                                
.withDimensionsSpec(TestDataSet.NUMFOO.getInputRowSchema()
+                                                                               
       .getDimensionsSpec())
+                                                .withMetrics(
+                                                    new 
Bitmap64ExactCountBuildAggregatorFactory(
+                                                        "unique_m1_values",
+                                                        "m1"
+                                                    ),
+                                                    new 
HyperUniquesAggregatorFactory(
+                                                        "hyper_unique_m1",
+                                                        "m1"
+                                                    )
+                                                )
+                                                .withRollup(false)
+                                                .build()
+                      )
+                      .rows(TestDataBuilder.ROWS1_WITH_NUMERIC_DIMS)
+                      .buildMMappedIndex();
+
+      return walker.add(
+          DataSegment.builder()

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [DataSegment.builder](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/9902)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to