Adapt for json - #18
Closed
w256 wants to merge 2 commits into
Closed
Conversation
Owner
|
すみません、こちらは副作用が想定できるため対応が検討中のままでした。 |
y-ken
added a commit
that referenced
this pull request
Jun 16, 2026
MySQL JSON columns are returned by the driver as plain strings, so they reached Elasticsearch as escaped strings instead of nested objects. Add a `json_columns` option that lists the columns whose values should be parsed into nested objects before they are emitted. - in_mysql_replicator: new `json_columns` config_param - in_mysql_replicator_multi: new `json_columns` settings column (varchar) - Malformed JSON, non-string and unlisted columns are left untouched, so the default behavior is unchanged (opt-in, no side effects) - Document that this targets Elasticsearch; leave it empty for Solr or destinations that cannot store JSON objects - Unit tests for parsing/config and single & multi E2E that assert the column is indexed as a nested object Refs #18 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merged
Owner
|
ご報告と PR、ありがとうございます。ここで挙げていただいた問題は #48(マージ済み・v1.2.0 で同梱)で別アプローチにより解決しましたので、その内容を共有したうえでクローズさせてください。 同じ問題が解決しますご提示の "geometry":"{\"type\": \"Polygon\", \"coordinates\": [[[136.8, 35.1], ...]]}"#48 で追加した その列だけを "geometry":{"type":"Polygon","coordinates":[[[136.8,35.1], ...]]}
なぜ置換ではなくこの方式にしたかいただいた
という点で、同じ目的をより安全に達成できます。 この機能はまさにこの Issue の要望から生まれたものです。ありがとうございました 🙏 v1.2.0 で利用可能になります。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
大変便利にありがたく使わせていただいております。
mysqlのフィールドにjsonを使っている場合でも、esに登録できるように改変しました。
以下は改変作業の具体的な内容となります。
mysqlのgeometoryフィールドに以下のようなjsonが入っており、それをesにロードしたい場合、うまくいかない事象がありました。
そこで、esに送信しているデータを確認しましたところ、本対応前は以下のようになっていました。
以下のように登録前に置換を行うように変更したところロードが成功するようになりました。
「\"」を 「"」に置換「"{」を 「{」に置換「"}」を 「}」に置換