use of org.apache.phoenix.parse.BindableStatement in project phoenix by apache.
the class BaseConnectionlessQueryTest method assertRoundtrip.
protected static void assertRoundtrip(String sql) throws SQLException {
SQLParser parser = new SQLParser(sql);
BindableStatement stmt = null;
stmt = parser.parseStatement();
if (stmt.getOperation() != Operation.QUERY) {
return;
}
String newSQL = stmt.toString();
SQLParser newParser = new SQLParser(newSQL);
BindableStatement newStmt = null;
try {
newStmt = newParser.parseStatement();
} catch (SQLException e) {
fail("Unable to parse new:\n" + newSQL);
}
assertEquals("Expected equality:\n" + sql + "\n" + newSQL, stmt, newStmt);
}
Aggregations