@Test public void testValidateLogicalPlan(){ String sql = "Select * from myTable tbl where column1 = 100 and rcol1 > 5"; LogicalPlan plan = getLogicalPlan(sql); DummyPhysicalPlan physicalPlan = new DummyPhysicalPlan("dummyPlan", plan); boolean actual = physicalPlan.validateLogicalPlan(); boolean expected = true; assertEquals(expected, actual); }
public boolean validateLogicalPlan() { Color color = Color.GREEN; if (logicalPlan.getType() == SQLType.QUERY) { if (whereClause != null) { color = validateNode(whereClause.getChildNode(0)); } } return color == Color.GREEN; }
PhysicalPlan extends TreeNode { public boolean validateLogicalPlan() { Color color = Color.GREEN; if (logicalPlan.getType() == SQLType.QUERY) { if (whereClause != null) { color = validateNode(whereClause.getChildNode(0)); } } return color == Color.GREEN; } }
PhysicalPlan extends TreeNode { public boolean validateLogicalPlan() { Color color = Color.GREEN; if (logicalPlan.getType() == SQLType.QUERY) { if (whereClause != null) { color = validateNode(whereClause.getChildNode(0)); } } return color == Color.GREEN; } PhysicalPlan(String description, LogicalPlan logicalPlan); }
PhysicalPlan extends TreeNode { public boolean validateLogicalPlan() { Color color = Color.GREEN; if (logicalPlan.getType() == SQLType.QUERY) { if (whereClause != null) { color = validateNode(whereClause.getChildNode(0)); } } return color == Color.GREEN; } PhysicalPlan(String description, LogicalPlan logicalPlan); WhereClause getWhereClause(); Map<String, String> getColumnAliasMapping(); List<SelectItem> getSelectItems(); boolean validateLogicalPlan(); Color validateNode(TreeNode node); PhysicalPlan paginate(RangeNode<?> rangeNode); abstract List<String> getRangeCols(String table); abstract List<String> getQueryCols(String table); abstract RangeOperations<?> getRangeOperations(String table, String column); abstract boolean tableExists(String table); abstract boolean columnExists(String table, String column); abstract Map<String, Integer> getColumnTypeMap(String table); @Override Object clone(); boolean checkFilterNull(Comparator cmp, String value); boolean isFilterWithNull(FilterItem filterItem); }
PhysicalPlan extends TreeNode { public boolean validateLogicalPlan() { Color color = Color.GREEN; if (logicalPlan.getType() == SQLType.QUERY) { if (whereClause != null) { color = validateNode(whereClause.getChildNode(0)); } } return color == Color.GREEN; } PhysicalPlan(String description, LogicalPlan logicalPlan); WhereClause getWhereClause(); Map<String, String> getColumnAliasMapping(); List<SelectItem> getSelectItems(); boolean validateLogicalPlan(); Color validateNode(TreeNode node); PhysicalPlan paginate(RangeNode<?> rangeNode); abstract List<String> getRangeCols(String table); abstract List<String> getQueryCols(String table); abstract RangeOperations<?> getRangeOperations(String table, String column); abstract boolean tableExists(String table); abstract boolean columnExists(String table, String column); abstract Map<String, Integer> getColumnTypeMap(String table); @Override Object clone(); boolean checkFilterNull(Comparator cmp, String value); boolean isFilterWithNull(FilterItem filterItem);  }