Find toJson method even from DataSourceImpl against Embulk v0.10.2 or earlier, whose DataSource interace does not have "toJson" #24
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.
An issue was reported about
embulk-input-s3:0.5.1usingembulk-util-config:0.2.0, when running it on Embulk v0.9.23. It was not happening withembulk-input-s3:0.5.0withembulk-util-config:0.1.4.This issue does not happen when the user is running Embulk v0.10.3+.
It was because :
org.embulk.config.DataSourceinterface does not havetoJson.toJson, and instead to fallback to invokinggetObjectNode.DataSourceobject was an instance ofembulk-util-config'sDataSourceImplwhich does not havegetObjectNode.We still had to try looking for
toJsoneven from the implementation class.By another fix in #20,
embulk-util-config'sDataSourceImplhas already beenpublic. Then, invoking thetoJsonMethodshould succeed if all the loaded plugins are also usingembulk-util-config:0.2.1+orembulk-core'sDataSourceImpl.Only a remaining case that this pull-request cannot save is :
embulk-util-config:0.1.4or earlier.To save this case, I prepared another fix #26. But still wondering whether we should merge this or not... (because it is too hacky).
Reproducing case on Embulk v0.9.23 (Copied from https://gist.github.com/Yasushi/9f24aa4f245284086d31a0862d2895c3)