# Elasticsearch on hive join query not working!

**URL:** https://discuss.elastic.co/t/elasticsearch-on-hive-join-query-not-working/23224
**Category:** Elasticsearch
**Created:** [April 14, 2015, 6:51am UTC](https://discuss.elastic.co/t/elasticsearch-on-hive-join-query-not-working/23224 "2015-04-14T06:51:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![11183](https://avatars.discourse-cdn.com/v4/letter/1/f04885/32.png) [@11183](https://discuss.elastic.co/u/11183)
#### Post date: [April 14, 2015, 6:51am UTC](https://discuss.elastic.co/t/elasticsearch-on-hive-join-query-not-working/23224/1 "2015-04-14T06:51:28Z")

</div>

I have some question to using elastic search on hive  
I use a hive to join elasticsearch datas , but result value is null!(but  
each table has join key value)

here is my queries,

1. Create table

CREATE EXTERNAL TABLE join\_1 (  
fileownermailguid STRING,  
filecontent STRING  
)  
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
TBLPROPERTIES('es.resource' =  
'smartlap-mi\_filedata\_db-2015-03-27/1721979161', 'es.nodes' =  
'172.19.79.167,172.19.79.168', 'es.port' = '9200')

CREATE EXTERNAL TABLE join\_2 (  
mailguid STRING,  
mailsize INT  
)  
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
TBLPROPERTIES('es.resource' =  
'smartlap-mi\_maildata\_db-2015-03-27/1721979161', 'es.nodes' =  
'172.19.79.167,172.19.79.168', 'es.port' = '9200')

1. Join query  
select a.mailguid, b.filecontent  
from join\_2 a join (select fileownermailguid,filecontent from join\_1) b  
on a.mailguid = b.fileownermailguid

2. select each table  
select a.mailguid, a.mailsize  
from join\_2 a  
where a.mailguid='50CDBC9B-D36B-4272-8AA5-CF3ED5F79039'

select fileownermailguid from join\_1 where  
fileownermailguid='50CDBC9B-D36B-4272-8AA5-CF3ED5F79039'

there is a result appeared in each tables, but, when I use join query,  
there is no result set  
elasticsearch on hive is not work well?

My Es version is 1.4.2, Es-hadoop version is 2.1.0.Beta3 and hive version  
is 0.13.1

--  
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/13815098-f5f2-4bad-bff5-22ab708dd515%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13815098-f5f2-4bad-bff5-22ab708dd515%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:19am UTC](https://discuss.elastic.co/t/elasticsearch-on-hive-join-query-not-working/23224/2 "2017-07-06T00:19:58Z")

</div>


