You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2016/10/03 17:06:20 UTC

[jira] [Commented] (SPARK-12985) Spark Hive thrift server big decimal data issue

    [ https://issues.apache.org/jira/browse/SPARK-12985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15542877#comment-15542877 ] 

Dongjoon Hyun commented on SPARK-12985:
---------------------------------------

Hi, [~alexliu68] and [~adrian-wang].
I reached here while I'm reviewing some issues about `SparkExecuteStatementOperator.scala`.
If there is no problem with other drivers, it seems that we can close this issue as 'NOT A PROBLE'.
How do you think about that?

> Spark Hive thrift server big decimal data issue
> -----------------------------------------------
>
>                 Key: SPARK-12985
>                 URL: https://issues.apache.org/jira/browse/SPARK-12985
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.6.0
>            Reporter: Alex Liu
>            Priority: Minor
>
> I tested the trial version JDBC driver from Simba, it works for simple query. But there is some issue with data mapping. e.g.
> {code}
> java.sql.SQLException: [Simba][SparkJDBCDriver](500312) Error in fetching data rows: java.math.BigDecimal cannot be cast to org.apache.hadoop.hive.common.type.HiveDecimal;
> 	at com.simba.spark.hivecommon.api.HS2Client.buildExceptionFromTStatus(Unknown Source)
> 	at com.simba.spark.hivecommon.api.HS2Client.fetchNRows(Unknown Source)
> 	at com.simba.spark.hivecommon.api.HS2Client.fetchRows(Unknown Source)
> 	at com.simba.spark.hivecommon.dataengine.BackgroundFetcher.run(Unknown Source)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> Caused by: com.simba.spark.support.exceptions.GeneralException: [Simba][SparkJDBCDriver](500312) Error in fetching data rows: java.math.BigDecimal cannot be cast to org.apache.hadoop.hive.common.type.HiveDecimal;
> 	... 8 more
> {code}
> To fix it
> {code}
>        case DecimalType() =>
>  -        to += from.getDecimal(ordinal)
>  +        to += HiveDecimal.create(from.getDecimal(ordinal))
> {code}
> to https://github.com/apache/spark/blob/master/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala#L87



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org