001package gudusoft.gsqlparser.ir.semantic; 002 003/** 004 * Set-operation kind on a {@link StatementGraph}. Non-null only on the 005 * outer statement of a set-op program (slice 12); null on every regular 006 * SELECT statement, every CTE / FROM-subquery / scalar / set-op-branch 007 * body. 008 * 009 * <p>The enum encodes both the operator and the {@code ALL} flag: 010 * {@code UNION} vs {@code UNION_ALL}, {@code INTERSECT} vs 011 * {@code INTERSECT_ALL}, {@code MINUS} vs {@code MINUS_ALL}, 012 * {@code EXCEPT} vs {@code EXCEPT_ALL}. 013 * 014 * <p>{@code MINUS} (Oracle / Spark / Hive) and {@code EXCEPT} 015 * (PostgreSQL / SQL Server / standard) are kept distinct because the 016 * parser exposes them as separate {@link gudusoft.gsqlparser.ESetOperatorType} 017 * values; preserving the dialect signal at no cost. They are 018 * semantically equivalent but lexically distinguishable. 019 * 020 * <p>{@code UNION DISTINCT} (BigQuery / MySQL) is mapped to 021 * {@link #UNION} by the builder — it is a syntactic alias for the 022 * default {@code UNION}, not a separate semantic. 023 */ 024public enum SetOperator { 025 UNION, 026 UNION_ALL, 027 INTERSECT, 028 INTERSECT_ALL, 029 MINUS, 030 MINUS_ALL, 031 EXCEPT, 032 EXCEPT_ALL 033}