Skip to content

Commit ff3dfdc

Browse files
Adding big5 coalesce queries (#4127)
* Adding big5 coalesce queries Signed-off-by: Aaron Alvarez <aaarone@amazon.com> * Adding queries to PPLBig5IT Signed-off-by: Aaron Alvarez <aaarone@amazon.com> * Fixing queries and test files Signed-off-by: Aaron Alvarez <aaarone@amazon.com> * Updating queries Signed-off-by: Aaron Alvarez <aaarone@amazon.com> --------- Signed-off-by: Aaron Alvarez <aaarone@amazon.com> Co-authored-by: Aaron Alvarez <aaarone@amazon.com>
1 parent 6db8d80 commit ff3dfdc

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/big5/CalcitePPLBig5IT.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
package org.opensearch.sql.calcite.big5;
77

8+
import java.io.IOException;
89
import org.junit.FixMethodOrder;
10+
import org.junit.Test;
911
import org.junit.runners.MethodSorters;
1012

1113
@FixMethodOrder(MethodSorters.JVM)
@@ -16,4 +18,10 @@ public void init() throws Exception {
1618
super.init();
1719
enableCalcite();
1820
}
21+
22+
@Test
23+
public void coalesce_nonexistent_field_fallback() throws IOException {
24+
String ppl = sanitize(loadFromFile("big5/queries/coalesce_nonexistent_field_fallback.ppl"));
25+
timing(summary, "coalesce_nonexistent_field_fallback", ppl);
26+
}
1927
}

integ-test/src/test/java/org/opensearch/sql/calcite/big5/PPLBig5IT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

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

2222
@Override
2323
public void init() throws Exception {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source = big5
2+
| eval result = coalesce(dummy_field, `host.name`, `metrics.size`, 'unknown')
3+
| head 10

0 commit comments

Comments
 (0)