[GitHub] spark pull request #17835: [SPARK-20557] [SQL] Improve the error message for...

2017-05-05 Thread gatorsmile
Github user gatorsmile commented on a diff in the pull request:

https://github.com/apache/spark/pull/17835#discussion_r115113474
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
 ---
@@ -230,7 +230,9 @@ object JdbcUtils extends Logging {
   // scalastyle:on
 }
 
-if (answer == null) throw new SQLException("Unsupported type " + 
sqlType)
+if (answer == null) {
+  throw new SQLException("Unsupported type " + 
JDBCType.valueOf(sqlType).getName)
--- End diff --

Captured in line 236. Thanks!


---
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 #17835: [SPARK-20557] [SQL] Improve the error message for...

2017-05-02 Thread dongjoon-hyun
Github user dongjoon-hyun commented on a diff in the pull request:

https://github.com/apache/spark/pull/17835#discussion_r114460827
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
 ---
@@ -230,7 +230,9 @@ object JdbcUtils extends Logging {
   // scalastyle:on
 }
 
-if (answer == null) throw new SQLException("Unsupported type " + 
sqlType)
+if (answer == null) {
+  throw new SQLException("Unsupported type " + 
JDBCType.valueOf(sqlType).getName)
--- End diff --

Hi, @gatorsmile .
Then, it seems that we need to consider `IllegalArgumentException` from 
`JDBCType.valueOf` then.
Can we do that here?


---
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 #17835: [SPARK-20557] [SQL] Improve the error message for...

2017-05-02 Thread gatorsmile
GitHub user gatorsmile opened a pull request:

https://github.com/apache/spark/pull/17835

[SPARK-20557] [SQL] Improve the error message for unsupported JDBC types.

### What changes were proposed in this pull request?

So far, for unsupported data types, we simply output the type number 
instead of the type name.

```
java.sql.SQLException: Unsupported type 2014
```
After this PR, the message is like
```
java.sql.SQLException: Unsupported type TIMESTAMP_WITH_TIMEZONE
```

- Also upgrade the H2 version to `1.4.195` which has the type fix for 
"TIMESTAMP WITH TIMEZONE". Later, we will show a different error message when 
we accept the type TIMESTAMP WITH TIMEZONE 
(https://github.com/apache/spark/pull/17832). 

### How was this patch tested?
Added test cases.

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

$ git pull https://github.com/gatorsmile/spark h2

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

https://github.com/apache/spark/pull/17835.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 #17835


commit d199f7bdfcdda3859efc0d021b42ab65915db009
Author: Xiao Li 
Date:   2017-05-02T20:48:41Z

fix.




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