Logstash jdbc左外部联接作为子文档 [英] Logstash jdbc left outer join as subdocuments

查看:210
本文介绍了Logstash jdbc左外部联接作为子文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Logstash jdbc插件将MySQL数据导入ElasticSearch.由于左外部连接,我最终为单个父行"得到了多个子行".假设1个用户拥有1个或多个文档.我尝试对文档的文本进行group_concat,然后按用户ID分组,以每位用户保留1行.

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.

但是,MySQL的group_concat的长度限制为1024 ...

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

有人知道完全克服group_concat并将左外部联接作为嵌套文档处理的解决方案吗?

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

感谢

推荐答案

默认值为1024,但是您可以使用

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)

我在创建许多子对象/文档的复杂OUTER JOIN中使用它,到目前为止效果还不错.

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

这篇关于Logstash jdbc左外部联接作为子文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆