@Test(expected = IllegalArgumentException.class) public void testInvalidSetSystemProperties() throws IOException, ParseException { String sql = "ALTER SYSTEM SET bar = OFF"; SqlNodeList nodes = Planner.parse(sql); Validator validator = new Validator(); validator.extract(nodes); }
@VisibleForTesting void extract(SqlNodeList query) { for (SqlNode n : query) { if (n instanceof SqlSetOption) { extract((SqlSetOption) n); } else if (n instanceof SqlCreateFunction) { extract((SqlCreateFunction) n); } } }
Validator { @VisibleForTesting void extract(SqlNodeList query) { for (SqlNode n : query) { if (n instanceof SqlSetOption) { extract((SqlSetOption) n); } else if (n instanceof SqlCreateFunction) { extract((SqlCreateFunction) n); } } } }
Validator { @VisibleForTesting void extract(SqlNodeList query) { for (SqlNode n : query) { if (n instanceof SqlSetOption) { extract((SqlSetOption) n); } else if (n instanceof SqlCreateFunction) { extract((SqlCreateFunction) n); } } }  }
Validator { @VisibleForTesting void extract(SqlNodeList query) { for (SqlNode n : query) { if (n instanceof SqlSetOption) { extract((SqlSetOption) n); } else if (n instanceof SqlCreateFunction) { extract((SqlCreateFunction) n); } } }   }
Validator { @VisibleForTesting void extract(SqlNodeList query) { for (SqlNode n : query) { if (n instanceof SqlSetOption) { extract((SqlSetOption) n); } else if (n instanceof SqlCreateFunction) { extract((SqlCreateFunction) n); } } }    }