[ 
https://issues.apache.org/jira/browse/SPARK-24276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiao Li resolved SPARK-24276.
-----------------------------
       Resolution: Fixed
         Assignee: Maxim Gekk
    Fix Version/s: 2.4.0

> semanticHash() returns different values for semantically the same IS IN
> -----------------------------------------------------------------------
>
>                 Key: SPARK-24276
>                 URL: https://issues.apache.org/jira/browse/SPARK-24276
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.3.0
>            Reporter: Maxim Gekk
>            Assignee: Maxim Gekk
>            Priority: Minor
>             Fix For: 2.4.0
>
>
> When a plan is canonicalized any set-based operation, such as IS IN, should 
> have its expressions ordered as the order of expressions does not matter in 
> the evaluation of the operator.
> For instance:
> {code:scala}
> val df = spark.createDataFrame(Seq((1, 2)))
> val p1 = df.where('_1.isin(1, 2)).queryExecution.logical.canonicalized
> val p2 = df.where('_1.isin(2, 1)).queryExecution.logical.canonicalized
> val h1 = p1.semanticHash
> val h2 = p2.semanticHash
> {code}
> {code}
> df: org.apache.spark.sql.DataFrame = [_1: int, _2: int]
> p1: org.apache.spark.sql.catalyst.plans.logical.LogicalPlan =
> 'Filter '_1 IN (1,2)
> +- LocalRelation [_1#0, _2#1]
> p2: org.apache.spark.sql.catalyst.plans.logical.LogicalPlan =
> 'Filter '_1 IN (2,1)
> +- LocalRelation [_1#0, _2#1]
> h1: Int = -1384236508
> h2: Int = 939549189
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to