Logstash jdbc left outer join as subdocuments

余生长醉 提交于 2019-12-12 02:59:32

问题


I'm using the Logstash jdbc plugin to get MySQL data into ElasticSearch. Due to a left outer join I end up with multiple 'child rows' for a single 'parent row'. Say 1 user has 1 or more documents. I tried to group_concat the text of the documents and then group by by the user id to retain 1 row per user.

However, MySQL's group_concat has a length limit of 1024...

Does anyone know a solution to overcome the group_concat altogether and deal with left outer joins as nested documents?

Thanx


回答1:


The default value is 1024, but you may increase the allowed length for GROUP_CONCAT using

SET SESSION group_concat_max_len = 102400

or whatever length you deem necessary (more info in the official docs)

I'm using that in complex OUTER JOINs which create many child objects/documents, and it works pretty fine so far.



来源:https://stackoverflow.com/questions/35605811/logstash-jdbc-left-outer-join-as-subdocuments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!