# Insert undefined tuples length into ES

**URL:** <https://discuss.elastic.co/t/insert-undefined-tuples-length-into-es/53533>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [June 21, 2016, 3:55pm UTC](https://discuss.elastic.co/t/insert-undefined-tuples-length-into-es/53533 "2016-06-21T15:55:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florent\_Valdelievre](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@Florent\_Valdelievre](https://discuss.elastic.co/u/Florent_Valdelievre)\
**Post date:** [June 21, 2016, 3:55pm UTC](https://discuss.elastic.co/t/insert-undefined-tuples-length-into-es/53533/1 "2016-06-21T15:55:26Z")

</div>

Please consider the following content in test\_data.txt. Each lines contains an unlimited number of string comma delimited.

```
C#,winform,C++
java,pig,elasticsearch,hadoop

```

I would like to load each line into a tuple and store them in elasticsearch like the following for each document:

```
"tags": [
 [C#,winform,C++]
]

```

I have done the following:

```
DEFINE EsStorage org.elasticsearch.hadoop.pig.EsStorage (
                      'es.http.timeout= 5m',
                      'es.index.auto.create = true',
                      'es.nodes = X.X.X.X'
               );

ANSWERS = LOAD 'test_data.txt' USING PigStorage(',');
TAGS = FOREACH ANSWERS GENERATE * as (tags:tuple());
STORE TAGS INTO 'test/post' USING EsStorage;

```

FYI:

DESCRIBE TAGS;  
TAGS: {tags: ()}

DUMP TAGS  
(C#,winform,C++)  
(java,pig,elasticsearch,hadoop)

However, no tags is inserted into elastic, just two empty documents. any idea ?

```
{
	"took": 3,
	"timed_out": false,
	"_shards": {
		"total": 2,
		"successful": 2,
		"failed": 0
	},
	"hits": {
		"total": 2,
		"max_score": 1,
		"hits": [{
			"_index": "test",
			"_type": "post",
			"_id": "AVV1U57OmyhhWgMuCNGg",
			"_score": 1,
			"_source": {}
		}, {
			"_index": "test",
			"_type": "post",
			"_id": "AVV1U57OmyhhWgMuCNGf",
			"_score": 1,
			"_source": {}
		}]
	}
}
```

---

<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:24pm UTC](https://discuss.elastic.co/t/insert-undefined-tuples-length-into-es/53533/2 "2017-07-06T13:24:15Z")

</div>

Closed on July 6, 2017, 1:24pm UTC


