Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ public class PPLBuiltinOperators extends ReflectiveSqlOperatorTable {
public static final SqlAggFunction DISTINCT_COUNT_APPROX =
createUserDefinedAggFunction(
DistinctCountApproxLogicalAggFunction.class,
"DISTINCT_COUNT_APPROX",
// Substrait-standard name the analytics-engine backend resolves by (V3 overrides it).
"APPROX_COUNT_DISTINCT",
ReturnTypes.BIGINT_FORCE_NULLABLE,
null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.List;
import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.opensearch.client.Request;
import org.opensearch.sql.common.utils.StringUtils;
import org.opensearch.sql.exception.SemanticCheckException;
import org.opensearch.sql.ppl.PPLIntegTestCase;
Expand All @@ -52,16 +51,11 @@ public void init() throws Exception {

@Test
public void testSimpleCount0() throws IOException {
Request request1 = new Request("PUT", "/test/_doc/1?refresh=true");
request1.setJsonEntity("{\"name\": \"hello\", \"age\": 20}");
client().performRequest(request1);
Request request2 = new Request("PUT", "/test/_doc/2?refresh=true");
request2.setJsonEntity("{\"name\": \"world\", \"age\": 30}");
client().performRequest(request2);

JSONObject actual = executeQuery("source=test | stats count() as c");
// A bare auto-created index isn't parquet-backed; use the parquet-aware bank index (7 docs).
JSONObject actual =
executeQuery(String.format("source=%s | stats count() as c", TEST_INDEX_BANK));
verifySchema(actual, schema("c", "bigint"));
verifyDataRows(actual, rows(2));
verifyDataRows(actual, rows(7));
}

@Test
Expand Down
Loading