New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate java-base to use AirbyteProtocol #609
Conversation
@@ -77,9 +81,31 @@ public static Schema toSchema(AirbyteCatalog catalog) { | |||
.withName(airbyteStream.getName()) | |||
.withFields(list.stream().map(item -> new Field() | |||
.withName(item.getKey()) | |||
.withDataType(DataType.valueOf(item.getValue().get("type").asText().toUpperCase())) | |||
.withDataType(singerTypesToDataType(item.getValue().get("type"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have the word singer in a class that is AB specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment. purely a name issue. not actually singer specific. will fix tha name. https://github.com/airbytehq/airbyte/pull/609/files#r507447435
* @param singerTypes - list of types discovered by singer. | ||
* @return reduce down to one type which best matches the field's data type | ||
*/ | ||
private static DataType singerTypesToDataType(JsonNode node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not singer right this is jsonschema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. copy paste error. i stole this function from our other converter, but yes you are right. this is jsonschema type to data type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a hack around that we don't output the correct types from the integration images. Anything ABprotocol-compliant shouldn't output types that aren't specified in ABP imo.
FWIW I happened to add a fix for this in #610 that makes the integration images output this so this behavior isn't needed in AB core.
@sherifnada - can you be specific about what you feel is hack? this PR makes sure that the java integrations use the ab protocol and that the worker is able to handle valid json schema. I am not understanding what your concern is. |
@cgardens Maybe the confusion here is around what ABP's type system is. Is it supposed to be all of JsonSchema's types, or whatever is present in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm - brainfart. Got confused about types.
e9deced
to
7f6a983
Compare
What
With this PR we can run integrations fully using the Airbyte Protocol!!!!!
If you want to try this out, 1. run the app using the dev configs; 2. build the dev images locally for exchangratesapi source and the csv-destination destination and then 3. update these config files as follows. you should then be able to run exchangerates api to csv destination fully on airbyte protocol. once we have all the other existing sources migrated over, we can officially switch.
airbyte-config/init/src/main/resources/config/STANDARD_SOURCE/9fed261d-d107-47fd-8c8b-323023db6e20.json
airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION/8be1cf83-fde1-477f-a4ad-318d23c9f3c6.json