Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13930#discussion_r81268420
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala ---
    @@ -163,6 +164,19 @@ private[sql] class HiveSessionCatalog(
       }
     
       override def lookupFunction(name: FunctionIdentifier, children: 
Seq[Expression]): Expression = {
    +    try {
    +      lookupFunction0(name, children)
    +    } catch {
    +      case NonFatal(_) =>
    +        // SPARK-16228 ExternalCatalog may recognize `double`-type only.
    +        val newChildren = children.map { child =>
    +          if (child.dataType.isInstanceOf[DecimalType]) Cast(child, 
DoubleType) else child
    +        }
    +        lookupFunction0(name, newChildren)
    +    }
    +  }
    --- End diff --
    
    @dongjoon-hyun What is the reason that we need to `catch` an exception 
instead of letting the analyzer do the job?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to