Find NOT IN with a subquery
ProprietaryWhen the subquery can return a NULL, NOT IN evaluates to unknown for every row and the outer query silently returns nothing. Many planners also fail to rewrite NOT IN as an efficient anti-join. NOT EXISTS avoids both problems. NOT IN over a literal list is not flagged.
org. openrewrite. sql. antipattern. FindNotInSubqueryOptional
markSourceBoolean
Whether to mark each occurrence in source, and apply the fix where the rule remediates. Defaults to true; set to false to leave source untouched and report only to the data table, as an analysis-only pipeline requires.
mod run . --recipe= org. openrewrite. sql. antipattern. FindNotInSubqueryInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.