Manikandan Ganesan created SPARK-56100:
------------------------------------------

             Summary: Throw error when IN has no left-hand column or expression 
(e.g. WHERE IN (1,2)) 
                 Key: SPARK-56100
                 URL: https://issues.apache.org/jira/browse/SPARK-56100
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.0, 4.2.0
            Reporter: Manikandan Ganesan


In Spark SQL, if you write an IN condition but omit the column (or expression) 
before IN, for example, WHERE IN (1, 2, 3), the query can still run 
successfully instead of failing. We expect Spark to report an error in this 
situation, because the SQL is incomplete.

That leads to:
 * No clear error when the condition is missing the part before IN.
 * Misleading results. For example the filter can behave as if nothing matched 
(0 rows), so it can look like the query ran correctly when it actually didn't 
do what the user intended.
 
Examples
SELECT * FROM t WHERE IN (1, 2, 3);
DELETE FROM t WHERE IN ('a', 'b');
UPDATE t SET c = 1 WHERE IN (1, 2);

Expected behavior:
Fail fast with a clear, consistent message that something (a column or 
expression) must appear before IN.

Actual behavior:
Queries succeed but result in 0 rows returned (in SELECT), No rows updated or 
deleted (in UPDATE / DELETE). No clear indication is given that the query 
itself is malformed

Why it matters
Silent, empty-looking results are painful to debug, especially if you assume 
the engine would reject invalid SQL.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to