Skip to content

Conversation

@yas-okadatech
Copy link

With the current code, JsonNull is treated as json.
If the first 50 records doesn't have values in a certain cell, "embulk guess" will treat the cell as json (guessed from JsonNull).

I fixed JiraUtil.toLinkedHashMap to set null if JSON's value is JsonNull.
By this fix, type will be null, then embulk-util-guess cannot handle type == null correctly due to a bug.
ref: Fix guessing a timestamp format from null (Fix #25) by dmikurube · Pull Request #23 · embulk/embulk-util-guess
So I bumped embulk-util-guess to 0.2.0 too in order to fix this bug.

@yas-okadatech yas-okadatech marked this pull request as draft June 6, 2025 08:47
@yas-okadatech yas-okadatech self-assigned this Jun 10, 2025
@yas-okadatech yas-okadatech marked this pull request as ready for review June 10, 2025 05:10
}
else if(elem.isJsonNull()) {
result.put(key, null);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここを入れる前は、280行目 result.put(key, elem) が実行され、JsonNullのインスタンスが設定されていました (そのため、JSONと判定される)

@yas-okadatech yas-okadatech changed the title fix to treat JsonNull as string type fix to treat JsonNull as no type Jun 10, 2025
@yas-okadatech yas-okadatech changed the title fix to treat JsonNull as no type fix to treat JsonNull as no type (type = null) Jun 10, 2025
Copy link

@r-uehara0219 r-uehara0219 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yas-okadatech yas-okadatech merged commit 77ae91a into master Jun 10, 2025
1 check passed
@yas-okadatech yas-okadatech deleted the 34275-jsonnull branch June 10, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants