Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3032E200D54 for ; Fri, 24 Nov 2017 00:23:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2EC1C160C10; Thu, 23 Nov 2017 23:23:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6C93B160BFE for ; Fri, 24 Nov 2017 00:23:05 +0100 (CET) Received: (qmail 63509 invoked by uid 500); 23 Nov 2017 23:23:04 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 63498 invoked by uid 99); 23 Nov 2017 23:23:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2017 23:23:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9325ADFC3E; Thu, 23 Nov 2017 23:23:03 +0000 (UTC) From: gatorsmile To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #19801: [SPARK-22592][SQL] cleanup filter converting for ... Content-Type: text/plain Message-Id: <20171123232303.9325ADFC3E@git1-us-west.apache.org> Date: Thu, 23 Nov 2017 23:23:03 +0000 (UTC) archived-at: Thu, 23 Nov 2017 23:23:06 -0000 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