LogicalNode currentNode = block.getCurrentNode();
LogicalNode currentNode = block.getCurrentNode();
/** * Try to find the column from the current node and child node. It can find subexprs generated from the optimizer. * * @param block The current query block * @param columnRef The column reference to be found * @return The found column */ static Column resolveFromCurrentAndChildNode(LogicalPlan.QueryBlock block, ColumnReferenceExpr columnRef) throws UndefinedColumnException { if (block.getCurrentNode() != null && block.getCurrentNode().getInSchema() != null) { Column found = block.getCurrentNode().getInSchema().getColumn(columnRef.getCanonicalName()); if (found != null) { return found; } else if (block.getLatestNode() != null) { found = block.getLatestNode().getOutSchema().getColumn(columnRef.getName()); if (found != null) { return found; } } } return null; }
/** * Try to find the column from the current node and child node. It can find subexprs generated from the optimizer. * * @param block The current query block * @param columnRef The column reference to be found * @return The found column */ static Column resolveFromCurrentAndChildNode(LogicalPlan.QueryBlock block, ColumnReferenceExpr columnRef) throws UndefinedColumnException { if (block.getCurrentNode() != null && block.getCurrentNode().getInSchema() != null) { Column found = block.getCurrentNode().getInSchema().getColumn(columnRef.getCanonicalName()); if (found != null) { return found; } else if (block.getLatestNode() != null) { found = block.getLatestNode().getOutSchema().getColumn(columnRef.getName()); if (found != null) { return found; } } } return null; }