Skip to content

Commit

Permalink
Rename test builder MSQTester.setExpectedSegment (#16837)
Browse files Browse the repository at this point in the history
* Rename setExpectedSegment to setExpectedSegments in MSQTestBase.

* Add expected segments for max num segments test cases.
  • Loading branch information
abhishekrb19 authored Aug 2, 2024
1 parent 9b731e8 commit fe6772a
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void testReplaceMvdWithStringArraySkipValidation(String contextName, Map<
.setQueryContext(adjustedContext)
.setExpectedDataSource("foo")
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of(SegmentId.of("foo", Intervals.ETERNITY, "test", 0)))
.setExpectedSegments(ImmutableSet.of(SegmentId.of("foo", Intervals.ETERNITY, "test", 0)))
.setExpectedResultRows(
NullHandling.sqlCompatible()
? ImmutableList.of(
Expand Down Expand Up @@ -278,7 +278,7 @@ public void testReplaceMvdWithMvd(String contextName, Map<String, Object> contex
.setQueryContext(adjustedContext)
.setExpectedDataSource("foo")
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of(SegmentId.of("foo", Intervals.ETERNITY, "test", 0)))
.setExpectedSegments(ImmutableSet.of(SegmentId.of("foo", Intervals.ETERNITY, "test", 0)))
.setExpectedResultRows(
ImmutableList.of(
new Object[]{0L, null},
Expand Down Expand Up @@ -325,7 +325,7 @@ public void testInsertOnFoo1WithMultiValueToArrayGroupByWithDefaultContext(Strin
.setExpectedDataSource("foo1")
.setExpectedRowSignature(rowSignature)
.setQueryContext(context)
.setExpectedSegment(ImmutableSet.of(SegmentId.of("foo1", Intervals.ETERNITY, "test", 0)))
.setExpectedSegments(ImmutableSet.of(SegmentId.of("foo1", Intervals.ETERNITY, "test", 0)))
.setExpectedResultRows(expectedRows)
.verifyResults();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void testInsertWithoutRollupOnNestedData(String contextName, Map<String,
+ " GROUP BY 1\n"
+ " PARTITIONED BY ALL")
.setQueryContext(context)
.setExpectedSegment(ImmutableSet.of(SegmentId.of("foo1", Intervals.ETERNITY, "test", 0)))
.setExpectedSegments(ImmutableSet.of(SegmentId.of("foo1", Intervals.ETERNITY, "test", 0)))
.setExpectedDataSource("foo1")
.setExpectedRowSignature(RowSignature.builder()
.add("__time", ColumnType.LONG)
Expand Down Expand Up @@ -257,7 +257,7 @@ public void testInsertWithRollupOnNestedData(String contextName, Map<String, Obj
+ " GROUP BY 1\n"
+ " PARTITIONED BY ALL")
.setQueryContext(adjustedContext)
.setExpectedSegment(ImmutableSet.of(SegmentId.of("foo1", Intervals.ETERNITY, "test", 0)))
.setExpectedSegments(ImmutableSet.of(SegmentId.of("foo1", Intervals.ETERNITY, "test", 0)))
.setExpectedDataSource("foo1")
.setExpectedRowSignature(RowSignature.builder()
.add("__time", ColumnType.LONG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testExport() throws IOException
.setExpectedDataSource("foo1")
.setQueryContext(DEFAULT_MSQ_CONTEXT)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down Expand Up @@ -88,7 +88,7 @@ public void testExport2() throws IOException
.setExpectedDataSource("foo1")
.setQueryContext(DEFAULT_MSQ_CONTEXT)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down Expand Up @@ -127,7 +127,7 @@ public void testNumberOfRowsPerFile()
.setExpectedDataSource("foo1")
.setQueryContext(queryContext)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down Expand Up @@ -168,7 +168,7 @@ void testExportComplexColumns() throws IOException
.setExpectedDataSource("foo1")
.setQueryContext(DEFAULT_MSQ_CONTEXT)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down Expand Up @@ -219,7 +219,7 @@ void testExportSketchColumns() throws IOException
.setExpectedDataSource("foo1")
.setQueryContext(DEFAULT_MSQ_CONTEXT)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down Expand Up @@ -258,7 +258,7 @@ void testEmptyExport() throws IOException
.setExpectedDataSource("foo1")
.setQueryContext(DEFAULT_MSQ_CONTEXT)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down Expand Up @@ -335,7 +335,7 @@ public void testExportWithLimit() throws IOException
.setExpectedDataSource("foo1")
.setQueryContext(queryContext)
.setExpectedRowSignature(rowSignature)
.setExpectedSegment(ImmutableSet.of())
.setExpectedSegments(ImmutableSet.of())
.setExpectedResultRows(ImmutableList.of())
.verifyResults();

Expand Down
Loading

0 comments on commit fe6772a

Please sign in to comment.