// Even though this function applies generally to expressions and tables // and not just to TVEs as such, it is somewhat TVE-related because TVEs // represent the points where expression trees depend on tables. public static boolean isOperandDependentOnTable(AbstractExpression expr, String tableAlias) { assert (tableAlias != null); for (TupleValueExpression tve : ExpressionUtil.getTupleValueExpressions(expr)) { if (tableAlias.equals(tve.getTableAlias())) { return true; } } return false; }
// Even though this function applies generally to expressions and tables and not just to TVEs as // such, // this function is somewhat TVE-related because TVEs DO represent the points where expression // trees // depend on tables. public static boolean isOperandDependentOnTable(AbstractExpression expr, Table table) { for (TupleValueExpression tve : ExpressionUtil.getTupleValueExpressions(expr)) { // TODO: This clumsy testing of table names regardless of table aliases is // EXACTLY why we can't have nice things like self-joins. if (table.getTypeName().equals(tve.getTableName())) { return true; } } return false; }