Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve data from a solr indexed external table #16

Open
vishnucg opened this issue Nov 7, 2016 · 4 comments
Open

Cannot retrieve data from a solr indexed external table #16

vishnucg opened this issue Nov 7, 2016 · 4 comments
Labels

Comments

@vishnucg
Copy link

vishnucg commented Nov 7, 2016

I am able to load data into solr external table from another managed hive table.
I can see the data got indexed and do a serach on it using HUE interface.
But when I try to retrieve data from the solr table, it is throwing
"Failed with exception java.io.IOException:java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String".
I am using solr-hive-serde-2.2.6.jar (using com.lucidworks.hadoop.hive.LWStorageHandler) on Hive 1.1.0-cdh5.4.5

@acesar
Copy link
Contributor

acesar commented Nov 7, 2016

Can you share the schema of the hive table?

I suggest you to use Solr dynamic field for the hive table.

Example

   CREATE EXTERNAL TABLE solr (id string, string_field_s string, int_field_i int, ...)

See https://cwiki.apache.org/confluence/display/solr/Dynamic+Fields

@vishnucg
Copy link
Author

vishnucg commented Nov 7, 2016

I was trying this one:
CREATE EXTERNAL TABLE sales_table (id string, vin string, make_nm string,series_nm string,business_month string,msrp string,inctv_amt string )
STORED BY 'com.lucidworks.hadoop.hive.LWStorageHandler'
LOCATION ""
TBLPROPERTIES('solr.server.url'='',
'solr.collection'='sales_schema',
'solr.query'=':');

@acesar
Copy link
Contributor

acesar commented Nov 7, 2016

you can try changing the schema of the table,

CREATE EXTERNAL TABLE sales_table (id string, vin_s string, make_nm_s string,series_nm_s string,business_month_s string,msrp_s string,inctv_amt_s string )

I suspect that the business_month is an Integer and that is why you got that error.

@vishnucg
Copy link
Author

vishnucg commented Nov 7, 2016

Tried this dynamic fields approach, but throwing the same exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants