korlov42 commented on a change in pull request #9276:
URL: https://github.com/apache/ignite/pull/9276#discussion_r694827673
##########
File path:
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/QueryChecker.java
##########
@@ -89,6 +90,54 @@
return containsSubPlan("IgniteIndexScan(table=[[" + schema + ", " +
tblName + "]], index=[" + idxName + ']');
}
+ /**
+ * Ignite result row count mather.
+ *
+ * @param rowCount Expected result row count.
+ * @return Mather.
+ */
+ public static Matcher<String> containsResultRowCount(double rowCount) {
+ String rowCountStr = String.format(".*rowcount = %s,.*",
printCostVal(rowCount));
+
+ return new RegexpMather(rowCountStr);
+ }
+
+ /**
+ * Regexp string mather.
+ */
+ private static class RegexpMather extends CustomTypeSafeMatcher<String> {
+ /** Compilled pathern. */
+ private Pattern pattern;
+
+ /**
+ * Constructor.
+ *
+ * @param regexp Regexp to search.
+ */
+ public RegexpMather(String regexp) {
+ super(regexp);
+
+ pattern = Pattern.compile(regexp, Pattern.DOTALL);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected boolean matchesSafely(String item) {
+ java.util.regex.Matcher matcher = pattern.matcher(item);
+
+ return matcher.matches();
+ }
+ }
+
+ /**
+ * Print cost value to regexp.
+ *
+ * @param val Value to print.
+ * @return String representation for regexp.
+ */
+ private static String printCostVal(Double val) {
Review comment:
we don't need this anymore
--
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]