[GitHub] spark pull request #18527: [SPARK-21101][SQL] Catch IllegalStateException wh...
Github user asfgit closed the pull request at: https://github.com/apache/spark/pull/18527 --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[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-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #18527: [SPARK-21101][SQL] Catch IllegalStateException wh...
Github user dongjoon-hyun commented on a diff in the pull request: https://github.com/apache/spark/pull/18527#discussion_r125518146 --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala --- @@ -99,6 +99,14 @@ private[sql] class HiveSessionCatalog( throw new AnalysisException(s"No handler for Hive UDF '${clazz.getCanonicalName}'") } } catch { +case ise: IllegalStateException => --- End diff -- Hi, @wangyum . Can we move this after line 112, `case NonFatal(e) =>`? IMO, these 8 lines are mostly duplication logic of line 113~116. The only difference is error message. I guess we can append the new error message more simply. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] spark pull request #18527: [SPARK-21101][SQL] Catch IllegalStateException wh...
GitHub user wangyum opened a pull request: https://github.com/apache/spark/pull/18527 [SPARK-21101][SQL] Catch IllegalStateException when CREATE TEMPORARY FUNCTION ## What changes were proposed in this pull request? It must `override` [`public StructObjectInspector initialize(ObjectInspector[] argOIs)`](https://github.com/apache/hive/blob/release-2.0.0/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTF.java#L70) when create a UDTF. If you `override` [`public StructObjectInspector initialize(StructObjectInspector argOIs)`](https://github.com/apache/hive/blob/release-2.0.0/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTF.java#L49), `IllegalStateException` will throw. per: [HIVE-12377](https://issues.apache.org/jira/browse/HIVE-12377). This PR catch `IllegalStateException` and point user to `override` `public StructObjectInspector initialize(ObjectInspector[] argOIs)`. ## How was this patch tested? manual tests You can merge this pull request into a Git repository by running: $ git pull https://github.com/wangyum/spark SPARK-21101 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/18527.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 #18527 commit a3bd52b6d96ca3b339402047ca612f638fa1e9fb Author: Yuming WangDate: 2017-07-04T12:59:21Z catch AnalysisException --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org