[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-04-06 Thread ravipesala
Github user ravipesala commented on a diff in the pull request:


https://github.com/apache/incubator-carbondata/pull/398#discussion_r110117757
  
--- 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 = null
+if (input != null) {
+  if (input.split("Hint").length > 0 &&
+  input.split("Hint")(0).split("TextParsingException: ").length > 
1) {
+errorMessage = input.split("Hint")(0).split("TextParsingException: 
")(1)
+  }
--- End diff --

Just simplify as follows.
```
val hintSplit = input.split("Hint")
if (hintSplit.length > 0) {
  val parseSplit = hintSplit(0).split("TextParsingException: ")
  if (parseSplit.length > 1) {
   errorMessage = parseSplit(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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-04-05 Thread ravipesala
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-04-05 Thread ravipesala
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-01-19 Thread akashrn5
Github user akashrn5 closed the pull request at:

https://github.com/apache/incubator-carbondata/pull/398


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


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-01-19 Thread akashrn5
GitHub user akashrn5 reopened a pull request:

https://github.com/apache/incubator-carbondata/pull/398

[CARBONDATA-400] Error message for dataload with a column having more than 
10 characters.

* Problem: When the number of characters in a column exceeds 10 
characters whole string appears in beeline with exception.

Analysis: In univocity csv parser settings , the maximum number of 
characters per column is 10 and when it exceeds that limit, 
TextparsingException is thrown with
the complete string as error in beeline during data load.

Fix: Now a proper error message is displayed in beeline and complete error 
messages and parser settings details will be present in logs.
Impact area: Data loading with more than 10 characters in a single 
column.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/akashrn5/incubator-carbondata 
br_message_correction

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-carbondata/pull/398.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 #398






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


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-01-19 Thread akashrn5
Github user akashrn5 closed the pull request at:

https://github.com/apache/incubator-carbondata/pull/398


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


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-01-19 Thread akashrn5
GitHub user akashrn5 reopened a pull request:

https://github.com/apache/incubator-carbondata/pull/398

[CARBONDATA-400] Error message for dataload with a column having more than 
10 characters.

* Problem: When the number of characters in a column exceeds 10 
characters whole string appears in beeline with exception.

Analysis: In univocity csv parser settings , the maximum number of 
characters per column is 10 and when it exceeds that limit, 
TextparsingException is thrown with
the complete string as error in beeline during data load.

Fix: Now a proper error message is displayed in beeline and complete error 
messages and parser settings details will be present in logs.
Impact area: Data loading with more than 10 characters in a single 
column.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/akashrn5/incubator-carbondata 
br_message_correction

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-carbondata/pull/398.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 #398


commit a303d30b07d80aec5e2d3c4526145c96a1e28b9f
Author: Akash R Nilugal 
Date:   2016-12-05T09:46:10Z

[CARBONDATA-400]
* Problem: When the number of characters in a column exceeds 10 
characters whole string appears in beeline with exception.

Analysis: In univocity csv parser settings , the maximum number of 
characters per column is 10 and when it exceeds that limit, 
TextparsingException is thrown with
the complete string as error in beeline during data load.

Fix: Now a proper error message is displayed in beeline and complete error 
messages and parser settings details will be present in logs.
Impact area: Data loading with more than 10 characters in a single 
column.




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


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-01-18 Thread akashrn5
GitHub user akashrn5 reopened a pull request:

https://github.com/apache/incubator-carbondata/pull/398

[CARBONDATA-400] Error message for dataload with a column having more than 
10 characters.

* Problem: When the number of characters in a column exceeds 10 
characters whole string appears in beeline with exception.

Analysis: In univocity csv parser settings , the maximum number of 
characters per column is 10 and when it exceeds that limit, 
TextparsingException is thrown with
the complete string as error in beeline during data load.

Fix: Now a proper error message is displayed in beeline and complete error 
messages and parser settings details will be present in logs.
Impact area: Data loading with more than 10 characters in a single 
column.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/akashrn5/incubator-carbondata 
br_message_correction

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-carbondata/pull/398.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 #398


commit dbe4c5ea048ed943b9b841acf697316be82232cc
Author: Akash R Nilugal 
Date:   2016-12-05T09:46:10Z

[CARBONDATA-400]
* Problem: When the number of characters in a column exceeds 10 
characters whole string appears in beeline with exception.

Analysis: In univocity csv parser settings , the maximum number of 
characters per column is 10 and when it exceeds that limit, 
TextparsingException is thrown with
the complete string as error in beeline during data load.

Fix: Now a proper error message is displayed in beeline and complete error 
messages and parser settings details will be present in logs.
Impact area: Data loading with more than 10 characters in a single 
column.




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


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2017-01-18 Thread akashrn5
Github user akashrn5 closed the pull request at:

https://github.com/apache/incubator-carbondata/pull/398


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


[GitHub] incubator-carbondata pull request #398: [CARBONDATA-400] Error message for d...

2016-12-05 Thread gvramana
Github user gvramana commented on a diff in the pull request:

https://github.com/apache/incubator-carbondata/pull/398#discussion_r91021993
  
--- Diff: 
integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
 ---
@@ -836,8 +836,15 @@ 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(
+  "Global dictionary generation failed. Please check the 
logs.")
--- End diff --

We cannot generally handle this SparkException, also we have to avoid 
"check logs". So handle specific TextParseException and compose required error 
message, during parsing only.


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