# ElasticsearchHadoop Hive integration issue

**URL:** https://discuss.elastic.co/t/elasticsearchhadoop-hive-integration-issue/15121
**Category:** Elasticsearch
**Created:** [January 7, 2014, 7:48am UTC](https://discuss.elastic.co/t/elasticsearchhadoop-hive-integration-issue/15121 "2014-01-07T07:48:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Badal\_Mohapatra](https://avatars.discourse-cdn.com/v4/letter/b/f0a364/32.png) [@Badal\_Mohapatra](https://discuss.elastic.co/u/Badal_Mohapatra)
#### Post date: [January 7, 2014, 7:48am UTC](https://discuss.elastic.co/t/elasticsearchhadoop-hive-integration-issue/15121/1 "2014-01-07T07:48:34Z")

</div>

Hi,

I am trying to index data from hive table to elasticsearch and and using  
the latest elasticsearch-hadoop-master plugin.  
My elasticsearch version is 0.90.9 and hive version is hive-0.11.0.

As per the documentation of elasticsearch-hadoop plugin (hive integration),  
I successfully created an external table with the below command

_CREATE EXTERNAL TABLE es\_products (sku int,rating float,name string,type  
string,saleprice float,department string,manufacturer string,userid  
string,category\_name string,query string) STORED BY  
'org.elasticsearch.hadoop.hive.ESStorageHandler'  
TBLPROPERTIES('es.resource' ='products');_

Even though the external table is created  
I am not able to either insert data or even query the external table.  
When I do a _select \* from es\_products;_  
I get the below exception.

hive\> select \* from es\_products;  
OK  
Failed with exception  
java.io.IOException:java.lang.StringIndexOutOfBoundsException: String index  
out of range: -1  
Time taken: 1.699 seconds

Can someone please suggest what / where I am wrong!

Kind Regards,  
Badal

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/dd63310c-dc07-4dc6-9354-69051a05da3f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dd63310c-dc07-4dc6-9354-69051a05da3f%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [January 7, 2014, 10:51am UTC](https://discuss.elastic.co/t/elasticsearchhadoop-hive-integration-issue/15121/2 "2014-01-07T10:51:01Z")

</div>

Hi,

The 'es.resource' you specified is incorrect - you need to specify both an index and a type - e.g. myIndex/products

P.S. Are you using M1 or the current master - the latter should give a proper error (and message).

Thanks,

On 07/01/2014 9:48 AM, Badal Mohapatra wrote:

> Hi,
> 
> ```
> I am trying to index data from hive table to elasticsearch and and using the latest elasticsearch-hadoop-master plugin.
> 
> ```
> 
> My elasticsearch version is 0.90.9 and hive version is hive-0.11.0.
> 
> As per the documentation of elasticsearch-hadoop plugin (hive integration), I successfully created an external table  
> with the below command
> 
> /CREATE EXTERNAL TABLE es\_products (  
> sku int,rating float,  
> name string,  
> type string,  
> saleprice float,  
> department string,  
> manufacturer string,  
> userid string,  
> category\_name string,  
> query string)  
> STORED BY 'org.elasticsearch.hadoop.hive.ESStorageHandler'  
> TBLPROPERTIES('es.resource' ='products');/
> 
> Even though the external table is created  
> I am not able to either insert data or even query the external table.  
> When I do a /select \* from es\_products;/  
> I get the below exception.
> 
> hive\> select \* from es\_products;  
> OK  
> Failed with exception java.io.IOException:java.lang.StringIndexOutOfBoundsException: String index out of range: -1  
> Time taken: 1.699 seconds
> 
> Can someone please suggest what / where I am wrong!
> 
> Kind Regards,  
> Badal
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/dd63310c-dc07-4dc6-9354-69051a05da3f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dd63310c-dc07-4dc6-9354-69051a05da3f%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).  
> --  
> Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/52CBDC15.6040307%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/52CBDC15.6040307%40gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Badal\_Mohapatra](https://avatars.discourse-cdn.com/v4/letter/b/f0a364/32.png) [@Badal\_Mohapatra](https://discuss.elastic.co/u/Badal_Mohapatra)
#### Post date: [January 8, 2014, 8:47am UTC](https://discuss.elastic.co/t/elasticsearchhadoop-hive-integration-issue/15121/3 "2014-01-08T08:47:51Z")

</div>

Hi Costin,

Thanks for your kind reply.  
After specifying the type in es.resource I am now able to index.

I am using M1, will try with master once indexing is done.

Regards,  
Badal

On Tuesday, 7 January 2014 16:21:01 UTC+5:30, Costin Leau wrote:

> Hi,
> 
> The 'es.resource' you specified is incorrect - you need to specify both an  
> index and a type - e.g. myIndex/products
> 
> P.S. Are you using M1 or the current master - the latter should give a  
> proper error (and message).
> 
> Thanks,
> 
> On 07/01/2014 9:48 AM, Badal Mohapatra wrote:
> 
> > Hi,
> > 
> > ```
> > I am trying to index data from hive table to elasticsearch and and 
> > 
> > ```
> 
> using the latest elasticsearch-hadoop-master plugin.
> 
> > My elasticsearch version is 0.90.9 and hive version is hive-0.11.0.
> > 
> > As per the documentation of elasticsearch-hadoop plugin (hive  
> > integration), I successfully created an external table  
> > with the below command
> > 
> > /CREATE EXTERNAL TABLE es\_products (  
> > sku int,rating float,  
> > name string,  
> > type string,  
> > saleprice float,  
> > department string,  
> > manufacturer string,  
> > userid string,  
> > category\_name string,  
> > query string)  
> > STORED BY 'org.elasticsearch.hadoop.hive.ESStorageHandler'  
> > TBLPROPERTIES('es.resource' ='products');/
> > 
> > Even though the external table is created  
> > I am not able to either insert data or even query the external table.  
> > When I do a /select \* from es\_products;/  
> > I get the below exception.
> > 
> > hive\> select \* from es\_products;  
> > OK  
> > Failed with exception  
> > java.io.IOException:java.lang.StringIndexOutOfBoundsException: String index  
> > out of range: -1  
> > Time taken: 1.699 seconds
> > 
> > Can someone please suggest what / where I am wrong!
> > 
> > Kind Regards,  
> > Badal
> > 
> > --  
> > You received this message because you are subscribed to the Google  
> > Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send  
> > an email to  
> > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/dd63310c-dc07-4dc6-9354-69051a05da3f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/dd63310c-dc07-4dc6-9354-69051a05da3f%40googlegroups.com).
> 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).  
> > --  
> > Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fdcdffc0-bffc-45b3-96dd-30e894c68677%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fdcdffc0-bffc-45b3-96dd-30e894c68677%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 1:57am UTC](https://discuss.elastic.co/t/elasticsearchhadoop-hive-integration-issue/15121/4 "2017-07-06T01:57:58Z")

</div>


