You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2017/10/24 18:23:16 UTC

[GitHub] spark pull request #18527: [SPARK-21101][SQL] Catch IllegalStateException wh...

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

    https://github.com/apache/spark/pull/18527#discussion_r146650137
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala ---
    @@ -95,7 +95,10 @@ private[sql] class HiveSessionCatalog(
           } catch {
             case NonFatal(e) =>
               val analysisException =
    -            new AnalysisException(s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e")
    +            new AnalysisException(s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e" +
    +              s"\nIf you create a UDTF, please make sure your function override " +
    +              s"`public StructObjectInspector initialize(ObjectInspector[] args)`, " +
    +              s"per: SPARK-21101")
    --- End diff --
    
    ```Scala
              val noHandlerMsg = s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e"
              val errorMsg =
                if (classOf[GenericUDTF].isAssignableFrom(clazz)) {
                  s"$noHandlerMsg\nPlease make sure your function overrides " +
                    "`public StructObjectInspector initialize(ObjectInspector[] args)`."
                } else {
                  noHandlerMsg
                }
              val analysisException = new AnalysisException(errorMsg)
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org