If you're up for tackling the scan_columns, that'd be great. It's easy enough to rip out on the HSQL side. The remaining decision is how to replicate its behavior on the other side. It requires access to the AbstractParsedStmt and is driven by any reference to a column regardless of where it may fit into which expressions. So, I'd probably use one of those List<AbstractExpression> building functions in ExpressionUtil to get the column references from the root of each expression tree as soon as it is built.