Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19801#discussion_r152880027
--- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala ---
@@ -643,9 +607,11 @@ private[client] class Shim_v0_13 extends Shim_v0_12 {
object ExtractableLiterals {
def unapply(exprs: Seq[Expression]): Option[Seq[String]] = {
- exprs.map(ExtractableLiteral.unapply).foldLeft(Option(Seq.empty[String])) {
- case (Some(accum), Some(value)) => Some(accum :+ value)
- case _ => None
+ val extractables = exprs.map(ExtractableLiteral.unapply)
+ if (extractables.nonEmpty && extractables.forall(_.isDefined)) {
--- End diff --
-> `if (extractables.exists(_.isDefined))`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
|