/** Returns whether two lists of operands are equal. */ public static boolean equalDeep(List<SqlNode> operands0, List<SqlNode> operands1, Litmus litmus) { if (operands0.size() != operands1.size()) { return litmus.fail(null); } for (int i = 0; i < operands0.size(); i++) { if (!SqlNode.equalDeep(operands0.get(i), operands1.get(i), litmus)) { return litmus.fail(null); } } return litmus.succeed(); } }
/** Returns whether two lists of operands are equal. */ public static boolean equalDeep(List<SqlNode> operands0, List<SqlNode> operands1, Litmus litmus) { if (operands0.size() != operands1.size()) { return litmus.fail(null); } for (int i = 0; i < operands0.size(); i++) { if (!SqlNode.equalDeep(operands0.get(i), operands1.get(i), litmus)) { return litmus.fail(null); } } return litmus.succeed(); } }
/** * Overridden method to specifically check only the right subtree of a window * definition. * * @param node The SqlWindow to compare to "this" window * @param litmus What to do if an error is detected (nodes are not equal) * * @return boolean true if all nodes in the subtree are equal */ @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { // This is the difference over super.equalsDeep. It skips // operands[0] the declared name fo this window. We only want // to check the window components. return node == this || node instanceof SqlWindow && SqlNode.equalDeep( Util.skip(getOperandList()), Util.skip(((SqlWindow) node).getOperandList()), litmus); }
/** * Overridden method to specifically check only the right subtree of a window * definition. * * @param node The SqlWindow to compare to "this" window * @param litmus What to do if an error is detected (nodes are not equal) * * @return boolean true if all nodes in the subtree are equal */ @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { // This is the difference over super.equalsDeep. It skips // operands[0] the declared name fo this window. We only want // to check the window components. return node == this || node instanceof SqlWindow && SqlNode.equalDeep( Util.skip(getOperandList()), Util.skip(((SqlWindow) node).getOperandList()), litmus); }
public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlDataTypeSpec)) { return litmus.fail("{} != {}", this, node); } SqlDataTypeSpec that = (SqlDataTypeSpec) node; if (!SqlNode.equalDeep( this.collectionsTypeName, that.collectionsTypeName, litmus)) { return litmus.fail(null); } if (!this.typeName.equalsDeep(that.typeName, litmus)) { return litmus.fail(null); } if (this.precision != that.precision) { return litmus.fail("{} != {}", this, node); } if (this.scale != that.scale) { return litmus.fail("{} != {}", this, node); } if (!Objects.equals(this.timeZone, that.timeZone)) { return litmus.fail("{} != {}", this, node); } if (!Objects.equals(this.charSetName, that.charSetName)) { return litmus.fail("{} != {}", this, node); } return litmus.succeed(); }
public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlDataTypeSpec)) { return litmus.fail("{} != {}", this, node); } SqlDataTypeSpec that = (SqlDataTypeSpec) node; if (!SqlNode.equalDeep( this.collectionsTypeName, that.collectionsTypeName, litmus)) { return litmus.fail(null); } if (!this.typeName.equalsDeep(that.typeName, litmus)) { return litmus.fail(null); } if (this.precision != that.precision) { return litmus.fail("{} != {}", this, node); } if (this.scale != that.scale) { return litmus.fail("{} != {}", this, node); } if (!Objects.equals(this.timeZone, that.timeZone)) { return litmus.fail("{} != {}", this, node); } if (!Objects.equals(this.charSetName, that.charSetName)) { return litmus.fail("{} != {}", this, node); } return litmus.succeed(); }