jibiyr commented on a change in pull request #2382:
URL: https://github.com/apache/calcite/pull/2382#discussion_r606052282



##########
File path: core/src/test/java/org/apache/calcite/test/SqlToRelTestBase.java
##########
@@ -796,6 +853,43 @@ public void assertConvertsTo(
       diffRepos.assertEquals("plan", plan, actual);
     }
 
+    public RexNode convertExprToRex(String expr) {
+      Objects.requireNonNull(expr, "expr");
+      final SqlNode sqlQuery;
+      try {
+        sqlQuery = parseExpression(expr);
+      } catch (RuntimeException | Error e) {
+        throw e;
+      } catch (Exception e) {
+        throw TestUtil.rethrow(e);
+      }
+      final RelDataTypeFactory typeFactory = getTypeFactory();
+      final Prepare.CatalogReader catalogReader =

Review comment:
       The duplicate code build both validator and SqlToRelConverter . Is it a 
good idea to let this code return Pair.of(SqlToRelConveter,SqlValidator)




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to