You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Anilkumar Kalshetti (JIRA)" <ji...@apache.org> on 2015/09/24 13:26:07 UTC

[jira] [Created] (SPARK-10794) Spark-SQL- select query on table column with binary Data Type displays error message- java.lang.ClassCastException: java.lang.String cannot be cast to [B

Anilkumar Kalshetti created SPARK-10794:
-------------------------------------------

             Summary: Spark-SQL- select query on table column with binary Data Type displays error message- java.lang.ClassCastException: java.lang.String cannot be cast to [B
                 Key: SPARK-10794
                 URL: https://issues.apache.org/jira/browse/SPARK-10794
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.5.0
         Environment: Spark 1.5.0 running on MapR 5.0 sandbox
            Reporter: Anilkumar Kalshetti
            Priority: Minor


Use beeline interface for Spark-SQL

1] Execute below query to create Table,

CREATE TABLE default.testbinary  ( 
c1 binary, 
c2 string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE;

2] Copy the attachment file: testbinary.txt in VM directory - /home/mapr/data/
and execute below script to load data in table

LOAD DATA LOCAL INPATH '/home/mapr/data/testbinary.txt' INTO TABLE testbinary

//testbinary.txt  contains data
1001,'russia'

3] Execute below 'Describe' command to get table information, and select command to get table data
describe  testbinary;

SELECT c1 FROM testbinary;

4] Select query displays error message:
 java.lang.ClassCastException: java.lang.String cannot be cast to [B 

Info:  for same table - select query on column c2 - string datatype works properly
SELECT c2 FROM testbinary;

Please refer screenshot- binaryDataType.png



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