GitHub user ueshin opened a pull request:
https://github.com/apache/spark/pull/22041
[SPARK-25058][SQL] Use Block.isEmpty/nonEmpty to check whether the code is
empty or not.
## What changes were proposed in this pull request?
We should use `Block.isEmpty/nonEmpty` instead of comparing with empty
string to check whether the code is empty or not.
```
[error] [warn]
/.../sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala:278:
org.apache.spark.sql.catalyst.expressions.codegen.Block and String are
unrelated: they will most likely always compare unequal
[error] [warn] if (ev.code != "" && required.contains(attributes(i)))
{
[error] [warn]
[error] [warn]
/.../sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala:323:
org.apache.spark.sql.catalyst.expressions.codegen.Block and String are
unrelated: they will most likely never compare equal
[error] [warn] | ${buildVars.filter(_.code == "").map(v =>
s"${v.isNull} = true;").mkString("\n")}
[error] [warn]
```
## How was this patch tested?
Existing tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ueshin/apache-spark
issues/SPARK-25058/fix_comparison
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/22041.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #22041
----
commit fa7e1b1dccb007840cbd536707d6d7ea098ffb9a
Author: Takuya UESHIN <ueshin@...>
Date: 2018-08-08T16:12:42Z
Fix comparison of `ev.code`.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]