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 Wed, 05 Apr 2017 16:27:55 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/398#discussion_r109963768
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
---
    @@ -784,11 +784,24 @@ 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(
    +              trimErrorMessage(spx.getMessage))
    +          case _ =>
    +            LOGGER.error(ex, "generate global dictionary failed")
    +            throw ex
    +        }
         }
       }
     
    +  // Get proper error message of TextParsingException
    +  def trimErrorMessage(input: String): String = {
    +    val message = input.split("Hint")(0).split("TextParsingException: ")(1)
    --- End diff --
    
    There may be chances of input is null because `spsx.getMessage()` can be null, so handle
NPE here.
    And also please check the array length after you split with `"Hint"`, other wise we may
get ArrayIndexOutOfBoundException.


---
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