Load ES Nested Mapping from Hive

Hi,

I'm trying to load an ES nested mapping from Hive.
My tables are listed below:

CREATE TABLE ORDER(
order_id bigint,
total_amount bigint,
customer bigint)
STORED AS ORC

CREATE TABLE ORDER_DETAILS(
order_id bigint,
Order_Item_id bigint,
Item_Size bigint,
Item_amount bigint,
Item_type string)
STORED AS ORC

Order and Order_Details have a 1-M relationship

I want to store the data above into Elasticseacrh, such that Order_Details
is a Nested Mapping of Order.

My ES Mapping would look somehwat like this

{
"order" : {
"orderid" : {"type": "float" },
"total_amount" : {"type": "float" },
"customer" : {"type": "float" }
"properties" : {
"order_details" : {
"type" : "nested",
"properties": {
"Order_Item_id" : {"type": "float" },
"Item_Size" : {"type": "float" },
"Item_amount" : {"type": "float" },
"Item_type": {"type": "string" }
}
}
}
}
}

My question is how do I convert the 1-M relation in Hive and load it into
ES mapping?

Possible Solution
I will create another Hive table which will contain the join query of the
two source Hive tables
But what is structure of this Hive table, so that it maps to ES mapping?

Any help/suggestions?

Thanks
Ankur

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/cdfee0e9-e0fa-47e4-b847-55b010984574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

Can anyone point me to an example on how to resolve this if data is in Hive?

Thanks

On Tuesday, 24 March 2015 16:10:55 UTC-5, Ankur Wahi wrote:

Hi,

I'm trying to load an ES nested mapping from Hive.
My tables are listed below:

CREATE TABLE ORDER(
order_id bigint,
total_amount bigint,
customer bigint)
STORED AS ORC

CREATE TABLE ORDER_DETAILS(
order_id bigint,
Order_Item_id bigint,
Item_Size bigint,
Item_amount bigint,
Item_type string)
STORED AS ORC

Order and Order_Details have a 1-M relationship

I want to store the data above into Elasticseacrh, such that Order_Details
is a Nested Mapping of Order.

My ES Mapping would look somehwat like this

{
"order" : {
"orderid" : {"type": "float" },
"total_amount" : {"type": "float" },
"customer" : {"type": "float" }
"properties" : {
"order_details" : {
"type" : "nested",
"properties": {
"Order_Item_id" : {"type": "float" },
"Item_Size" : {"type": "float" },
"Item_amount" : {"type": "float" },
"Item_type": {"type": "string" }
}
}
}
}
}

My question is how do I convert the 1-M relation in Hive and load it into
ES mapping?

Possible Solution
I will create another Hive table which will contain the join query of the
two source Hive tables
But what is structure of this Hive table, so that it maps to ES mapping?

Any help/suggestions?

Thanks
Ankur

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/581bee54-ced2-4a8f-9043-c20037818c70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.