abhishekagarwal87 commented on code in PR #15096:
URL: https://github.com/apache/druid/pull/15096#discussion_r1351968820
##########
sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java:
##########
@@ -142,65 +264,231 @@ public SpecificSegmentsQuerySegmentWalker
createQuerySegmentWalker(
new LongDimensionSchema("col6"),
new StringDimensionSchema("col7"),
new StringDimensionSchema("col8"),
- new StringDimensionSchema("col9")
- );
+ new StringDimensionSchema("col9"));
+ attachIndex(
+ retVal,
+ "smlTbl.parquet",
+ // "col_int": 8122,
+ new LongDimensionSchema("col_int"),
+ // "col_bgint": 817200,
+ new LongDimensionSchema("col_bgint"),
+ // "col_char_2": "IN",
+ new StringDimensionSchema("col_char_2"),
+ // "col_vchar_52":
+ // "AXXXXXXXXXXXXXXXXXXXXXXXXXCXXXXXXXXXXXXXXXXXXXXXXXXB",
+ new StringDimensionSchema("col_vchar_52"),
+ // "col_tmstmp": 1409617682418,
+ new LongDimensionSchema("col_tmstmp"),
+ // "col_dt": 422717616000000,
+ new LongDimensionSchema("col_dt"),
+ // "col_booln": false,
+ new StringDimensionSchema("col_booln"),
+ // "col_dbl": 12900.48,
+ new DoubleDimensionSchema("col_dbl"),
+ // "col_tm": 33109170
+ new LongDimensionSchema("col_tm"));
+ attachIndex(
+ retVal,
+ "fewRowsAllData.parquet",
+ // "col0":12024,
+ new LongDimensionSchema("col0"),
+ // "col1":307168,
+ new LongDimensionSchema("col1"),
+ // "col2":"VT",
+ new StringDimensionSchema("col2"),
+ // "col3":"DXXXXXXXXXXXXXXXXXXXXXXXXXEXXXXXXXXXXXXXXXXXXXXXXXXF",
+ new StringDimensionSchema("col3"),
+ // "col4":1338596882419,
+ new LongDimensionSchema("col4"),
+ // "col5":422705433600000,
+ new LongDimensionSchema("col5"),
+ // "col6":true,
+ new StringDimensionSchema("col6"),
+ // "col7":3.95110006277E8,
+ new DoubleDimensionSchema("col7"),
+ // "col8":67465430
+ new LongDimensionSchema("col8"));
+ attachIndex(
+ retVal,
+ "t_alltype.parquet",
+ // "c1":1,
+ new LongDimensionSchema("c1"),
+ // "c2":592475043,
+ new LongDimensionSchema("c2"),
+ // "c3":616080519999272,
+ new LongDimensionSchema("c3"),
+ // "c4":"ObHeWTDEcbGzssDwPwurfs",
+ new StringDimensionSchema("c4"),
+ // "c5":"0sZxIfZ CGwTOaLWZ6nWkUNx",
+ new StringDimensionSchema("c5"),
+ // "c6":1456290852307,
+ new LongDimensionSchema("c6"),
+ // "c7":421426627200000,
+ new LongDimensionSchema("c7"),
+ // "c8":true,
+ new StringDimensionSchema("c8"),
+ // "c9":0.626179100469
+ new DoubleDimensionSchema("c9"));
return retVal;
}
- @Test
+ public class TextualResultsVerifier implements ResultsVerifier
+ {
+ protected final List<String[]> expectedResultsText;
+ @Nullable
+ protected final RowSignature expectedResultRowSignature;
+ private RowSignature currentRowSignature;
+
+ public TextualResultsVerifier(List<String[]> expectedResultsString,
RowSignature expectedSignature)
+ {
+ this.expectedResultsText = expectedResultsString;
+ this.expectedResultRowSignature = expectedSignature;
+ }
+
+ @Override
+ public void verifyRowSignature(RowSignature rowSignature)
+ {
+ if (expectedResultRowSignature != null) {
+ Assert.assertEquals(expectedResultRowSignature, rowSignature);
+ }
+ currentRowSignature = rowSignature;
+ }
+
+ @Override
+ public void verify(String sql, List<Object[]> results)
+ {
+ List<Object[]> expectedResults = parseResults(currentRowSignature,
expectedResultsText);
+ try {
+ Assert.assertEquals(StringUtils.format("result count: %s", sql),
expectedResultsText.size(), results.size());
+ if (!isOrdered(sql)) {
Review Comment:
can be done in a follow-up PR.
--
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]