protected Tester getTester() { return new UnparsingTesterImpl(); } }
public void checkExp(String sql, String expected) { SqlNode sqlNode = parseExpressionAndHandleEx(sql); // Unparse with no dialect, always parenthesize. final String actual = sqlNode.toSqlString(null, true).getSql(); assertEquals(expected, actual); // Unparse again in Eigenbase dialect (which we can parse), and // minimal parentheses. final String sql1 = sqlNode.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Parse and unparse again. SqlNode sqlNode2 = parseExpressionAndHandleEx(sql1); final String sql2 = sqlNode2.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Should be the same as we started with. assertEquals(sql1, sql2); // Now unparse again in the null dialect. // If the unparser is not including sufficient parens to override // precedence, the problem will show up here. final String actual2 = sqlNode2.toSqlString(null, true).getSql(); assertEquals(expected, actual2); }
public void check(String sql, String expected) { SqlNode sqlNode = parseStmtAndHandleEx(sql); // Unparse with no dialect, always parenthesize. final String actual = sqlNode.toSqlString(null, true).getSql(); assertEquals(expected, actual); // Unparse again in Eigenbase dialect (which we can parse), and // minimal parentheses. final String sql1 = sqlNode.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Parse and unparse again. SqlNode sqlNode2 = parseStmtAndHandleEx(sql1); final String sql2 = sqlNode2.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Should be the same as we started with. assertEquals(sql1, sql2); // Now unparse again in the null dialect. // If the unparser is not including sufficient parens to override // precedence, the problem will show up here. final String actual2 = sqlNode2.toSqlString(null, true).getSql(); assertEquals(expected, actual2); }
public void checkExp(String sql, String expected) { SqlNode sqlNode = parseExpressionAndHandleEx(sql); // Unparse with no dialect, always parenthesize. final String actual = sqlNode.toSqlString(null, true).getSql(); assertEquals(expected, actual); // Unparse again in Eigenbase dialect (which we can parse), and // minimal parentheses. final String sql1 = sqlNode.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Parse and unparse again. SqlNode sqlNode2 = parseExpressionAndHandleEx(sql1); final String sql2 = sqlNode2.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Should be the same as we started with. assertEquals(sql1, sql2); // Now unparse again in the null dialect. // If the unparser is not including sufficient parens to override // precedence, the problem will show up here. final String actual2 = sqlNode2.toSqlString(null, true).getSql(); assertEquals(expected, actual2); }
public void check(String sql, String expected) { SqlNode sqlNode = parseStmtAndHandleEx(sql); // Unparse with no dialect, always parenthesize. final String actual = sqlNode.toSqlString(null, true).getSql(); assertEquals(expected, actual); // Unparse again in Eigenbase dialect (which we can parse), and // minimal parentheses. final String sql1 = sqlNode.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Parse and unparse again. SqlNode sqlNode2 = parseStmtAndHandleEx(sql1); final String sql2 = sqlNode2.toSqlString(SqlDialect.EIGENBASE, false).getSql(); // Should be the same as we started with. assertEquals(sql1, sql2); // Now unparse again in the null dialect. // If the unparser is not including sufficient parens to override // precedence, the problem will show up here. final String actual2 = sqlNode2.toSqlString(null, true).getSql(); assertEquals(expected, actual2); }
protected Tester getTester() { return new UnparsingTesterImpl(); } }