Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -5,7 +5,9 @@

package org.opensearch.sql.calcite.big5;

import java.io.IOException;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

@FixMethodOrder(MethodSorters.JVM)
Expand All @@ -16,4 +18,52 @@ public void init() throws Exception {
super.init();
enableCalcite();
}

@Test
public void bin_aligntime() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_aligntime.ppl"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ: Why do we need to load from separate file? Query seems simple and it should be simpler to write here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are adding this IT to verify if the queries we put under the big5 queries folder works, also to be consistent with merged PR: #4127

Copy link
Collaborator

@Swiddis Swiddis Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ keeping it separate helps us copy the queries as benchmark cases, we want to ideally just copy the contents of big5/queries and generate workloads from it.

timing(summary, "bin_aligntime", ppl);
}

@Test
public void bin_bins() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_bins.ppl"));
timing(summary, "bin_bins", ppl);
}

@Test
public void bin_default() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_default.ppl"));
timing(summary, "bin_default", ppl);
}

@Test
public void bin_minspan() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_minspan.ppl"));
timing(summary, "bin_minspan", ppl);
}

@Test
public void bin_span_log() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_span_log.ppl"));
timing(summary, "bin_span_log", ppl);
}

@Test
public void bin_span_numeric() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_span_numeric.ppl"));
timing(summary, "bin_span_numeric", ppl);
}

@Test
public void bin_span_time() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_span_time.ppl"));
timing(summary, "bin_span_time", ppl);
}

@Test
public void bin_start_end() throws IOException {
String ppl = sanitize(loadFromFile("big5/queries/bin_start_end.ppl"));
timing(summary, "bin_start_end", ppl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@FixMethodOrder(MethodSorters.JVM)
public class PPLBig5IT extends PPLIntegTestCase {
private static final MapBuilder<String, Long> summary = MapBuilder.newMapBuilder();
protected static final MapBuilder<String, Long> summary = MapBuilder.newMapBuilder();

@Override
public void init() throws Exception {
Expand Down
3 changes: 3 additions & 0 deletions integ-test/src/test/resources/big5/queries/bin_aligntime.ppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `@timestamp` span=12h aligntime=\"@d+3h\"
| head 10
3 changes: 3 additions & 0 deletions integ-test/src/test/resources/big5/queries/bin_bins.ppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `metrics.size` bins=5
| head 10
3 changes: 3 additions & 0 deletions integ-test/src/test/resources/big5/queries/bin_default.ppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `metrics.size`
| head 10
3 changes: 3 additions & 0 deletions integ-test/src/test/resources/big5/queries/bin_minspan.ppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `metrics.size` minspan=100
| head 10
3 changes: 3 additions & 0 deletions integ-test/src/test/resources/big5/queries/bin_span_log.ppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `metrics.size` span=log10
| head 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `metrics.size` span=1000
| head 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `@timestamp` span=1h
| head 10
3 changes: 3 additions & 0 deletions integ-test/src/test/resources/big5/queries/bin_start_end.ppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source = big5
| bin `metrics.size` bins=5 start=0 end=10000
| head 10
Loading