carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...
Date Thu, 06 Apr 2017 04:45:39 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/398#discussion_r110078344
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
---
    @@ -784,9 +784,28 @@ object GlobalDictionaryUtil {
           }
         } catch {
           case ex: Exception =>
    -        LOGGER.error(ex, "generate global dictionary failed")
    -        throw ex
    +        ex match {
    +          case spx: SparkException =>
    +            LOGGER.error(spx, "generate global dictionary failed")
    +            throw new Exception("generate global dictionary failed" +
    +                                trimErrorMessage(spx.getMessage))
    +          case _ =>
    +            LOGGER.error(ex, "generate global dictionary failed")
    +            throw ex
    +        }
    +    }
    +  }
    +
    +  // Get proper error message of TextParsingException
    +  def trimErrorMessage(input: String): String = {
    +    var errorMessage: String = ""
    +    if (input != null) {
    +      if (input.split("Hint").length > 0) {
    +        errorMessage = input.split("Hint")(0).split("TextParsingException: ")(1)
    --- End diff --
    
    even for `split("TextParsingException: ")` also check the length  more than 1. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message