1
0
mirror of synced 2025-12-20 18:39:31 -05:00
Commit Graph

238 Commits

Author SHA1 Message Date
Sherif A. Nada
efb5151011 🐛 Make all JDBC destinations (SF, RS, PG, MySQL, MSSQL, Oracle) handle wide rows by using byte-based record buffering (#7719) 2021-11-08 19:26:32 -08:00
Haoran Yu
92fcdea5bb Refactor JDBC JSON_Format into JDBC utils (#7504) 2021-11-02 20:20:33 -07:00
Harsha Teja Kanna
3e7f95c25a 🎉 Support build on MacOS M1 (Apple Silicon) (#7104)
- See this doc for details: https://github.com/airbytehq/airbyte/blob/master/docs/contributing-to-airbyte/developing-locally.md
- Unit test does not work yet.
2021-10-19 11:20:21 -07:00
Charles
ba44f700b9 add final for params, local variables, and fields (#7084) 2021-10-15 16:41:04 -07:00
Charles
5e750164ac Publish SSL-only version of Postgres Destination (#6496)
* try to publish new normalization version

* default to using ssl in postgres destinatoin

* tidy up

* Run normalization tests using postgres DB with SSL support

* bump version

Co-authored-by: Christophe Duong <christophe.duong@gmail.com>
2021-09-30 12:55:26 +02:00
Michel Tricot
1773e41e47 Shorten our headers + adds contributors file (#6478) 2021-09-27 10:45:50 -07:00
VitaliiMaltsev
ec3951ba62 🎉 Integration Testing for SSH using a docker container | Postgres Source and Destination update integration tests using ssh bastion in docker container (#6312)
* ssh-test

* add authentification via ssh tunnel with bastion docker host and postgres testcontainer

* created SshBastion class in base-java module

* implement Postgres source basic ssh tunneling connection for integration tests

* implement Postgres source ssh tunneling connection and refactoring SshBastion

* generate keys inside a bastion container

* remove throwing Exception from startTestContainers method

* fix checkstyle

* add documentation and changelog for Posthres source and destination

* update documentation for ssh readme.md | update version fo Postgres source and destination to 0.3.12

* update version of Postgres source and destination to 0.3.12

* removed static variables, removed version bump, rename class to SshBastionContainer, removed ci credentials for ssh Postgres Source and Destination

Co-authored-by: vmaltsev <vitalii.maltsev@globallogic.com>
2021-09-24 20:00:06 +03:00
Subodh Kant Chaturvedi
7591324351 introduce jvm flag MaxRAMPercentage for java connectors (#6001)
* introduce jvm flag MaxRAMPercentage for java connectors

* temporary commit to test this out on GKE via kube acceptance test

* undo temp commit
2021-09-22 19:59:39 +05:30
Andrii Leonets
9dcced9517 Java sources: Rework JdbcUtils (#5786)
* move logic from static JdbcUtils to JdbcSourceOperations

* format

* Add methods for all types in order to have possibility rewrite them and use common type mapping.

* Make BigQuery in line impl with JDBC changes

* fix binary type

* add database creations methods with sourceOperations input

* Update airbyte-db/lib/src/main/java/io/airbyte/db/SourceOperations.java

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2021-09-08 17:13:41 +03:00
Charles
8ad43afb07 SSH for Postgres Destination (#5743)
Co-authored-by: George Claireaux <phlair@users.noreply.github.com>
2021-09-07 17:06:25 -07:00
Andrii Leonets
b18bd439d0 🐛 Destination Postgres: fix \u0000(NULL) value processing (#5336)
* fix \u0000(NULL) value processing for Postgres + move postgres impl of SqlOperations to PostgresSqlOperations.

* changelog + format

* incr release version

* Add generic solution to adopt messages for a destination + remove unnecessary serialization

* revert version for build

* minor review fixes

* format

* add comments

* format

* incr version
2021-08-30 21:41:02 +03:00
LiRen Tu
b9e1997d2f Split airbyte-db and move db dev commands to gradle (#5616)
# Summary

- A follow-up PR for #5543.
- This PR separates the `airbyte-db` project to two modules:
  - `lib` is the original `airbyte-db`.
  - `jooq` is for jOOQ code generation.
- This is necessary because the jOOQ generator requires a custom database implementation that can run Flyway migration. So the code generator logic needs to depend on the compilation of the original `airbyte-db` project.

# Commits
* Separate db to lib and jooq modules
* Update dependencies
* Add jobs db migrator test
* Fix compose build
* Add migration dev center
* Add schema dump task
* Update airbyte-db/lib/README.md
  * Co-authored-by: Davin Chia <davinchia@gmail.com>
* Update readme
* Remove bom dependency
* Update readme
* Use jooq code in db config persistence
* Remove AirbyteConfigsTable

Co-authored-by: Davin Chia <davinchia@gmail.com>
2021-08-26 10:44:09 -07:00
Marcos Marx
21e6d49d3a Enable additionalProperties in spec.json for destinations (#5125)
* bigquery

* bigquery denormalized

* kafka destination

* meilisearch

* mssql

* mysql

* oracle

* postgres

* snowflake

* add normalization in snowflake gradle

* remove unused import
2021-08-01 18:28:36 -03:00
Charles
9a13c792cf Checkpointing: Partial Success in BufferedStreamConsumer (Destination) (#3555) 2021-07-21 15:26:40 -07:00
Subodh Kant Chaturvedi
8b45744276 Upgrade postgres and redshift destination to remove basic_normalization attribute (#4725)
* upgrade snowflake,redshift,postgres to remove basic_normalization

* undo snowflake

* undo snowflaketest
2021-07-13 20:24:38 +05:30
Subodh Kant Chaturvedi
8593071db0 🎉 migration: implement logic to migrate basic_normalization from destination to sync (#3624)
* migration: implement logic to migrate basic_normalization from destination to sync

* fix test

* fix test

* cleanup usage of basic_normalization from everywhere

* address review comments

* address review comments

* try to fix NPE

* address review comments

* resolve conflicts

* remove unwanted files
2021-06-14 14:20:41 +05:30
Jared Rhizor
b4793b2510 add AIRBYTE_ENTRYPOINT for kubernetes support (#3973)
* add AIRBYTE_ENTRYPOINT for kubernetes support

* bump versions

* bump version in seed

* Update generic template

* keep scaffold sources at 0.1.0

* add missing newline

* handle python base versions correctly

* re-bump mysql and postgres sources

* re-bump snowflake destination

* add skip tests option

* switch to running tests

* reverse conditional to make it safer

* fix publish to include the test running

* fix iterable version

* fix file generation

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2021-06-09 13:01:45 -07:00
Andrii Leonets
213fae17a1 MySQL source: Add comprehensive data type test (#3810) 2021-06-07 14:01:02 +03:00
LiRen Tu
c13b9883e8 🎉 New destination: S3 (#3672)
* Update README icon links

* Update airbyte-specification doc

* Extend base connector

* Remove redundant region

* Separate warning from info

* Implement s3 destination

* Run format

* Clarify logging message

* Rename variables and functions

* Update documentation

* Rename and annotate interface

* Inject formatter factory

* Remove part size

* Fix spec field names and add unit tests

* Add unit tests for csv output formatter

* Format code

* Complete acceptance test and fix bugs

* Fix uuid

* Remove generator template files

They belong to another PR.

* Add unhappy test case

* Checkin airbyte state message

* Adjust stream transfer manager parameters

* Use underscore in filename

* Create csv sheet generator to handle data processing

* Format code

* Add partition id to filename

* Rename date format variable
2021-06-03 09:40:51 -07:00
Subodh Kant Chaturvedi
6adad7d98e destination-specification: add supportsNormalization and supportsDBT attributes (#3779)
* destination-specification: add supportsNormalization and supportsDBT attributes

* address review comment

* missed this one

* output after gradle format
2021-06-01 17:40:28 +05:30
Charles
aa6afb7282 Checkpointing: Worker use destination (instead of source) for state (#3290)
* Migrate BufferedStreamConsumer users (e.g. all JDBC destinations, MeiliSearch) (#3473)

* Add checkpointing test cases in Acceptance Tests (#3473)

* Add testing for emitting state in Destination Standard Test (#3546)

* Migrate BQ to support checkpointing (#3546)

* Migrate copy destinations support checkpointing (#3547)

* Checkpointing: Migrate CSV and JSON destinations (#3551)
2021-05-25 16:47:40 -07:00
Charles
8983f09aea normalize connector acceptance test names (#3539)
* Rename standard tests to acceptance tests

* Normalize the names so that the nouns are always in the same order so it is easier to find tests
2021-05-22 13:40:40 -07:00
Davin Chia
99c7ac27ca Bugfix: BufferedStreamConsumer. (#3387)
* Format.

* Bump versions.
2021-05-13 16:38:23 +08:00
Jared Rhizor
6fd8e00ad8 don't split lines on LSEP unicode characters when reading lines in destinations (#3327)
* use strict JSONL definition of new lines in destinations

* failing test case

* use next instead of nextLine

* add \n in string for test

* bump destination versions

* bump to even newer version

* bump versions in dockerfiles as well

* force mysql test to pass
2021-05-10 12:57:12 -07:00
Charles
90d48a4ab4 bump all destination versions to support outputting messages (#3289) 2021-05-10 10:05:19 -07:00
Charles
06599d475d Write output records from destination to STDOUT (#3274) 2021-05-07 13:32:39 -07:00
Charles
e4d0707781 Destination Checkpointing: Add StateMessage handing to BufferedStreamConsumer (#3230) 2021-05-07 13:05:52 -07:00
Jared Rhizor
5c6d26885c use COPY for Postgres (#3204)
* postgres but faster

* fmt

* bump to 0.3.1
2021-05-04 09:20:51 -07:00
Davin Chia
42686add8a Release connectors with namespace change. (#2990)
Release all connectors affected by namespace change. Includes all JDBC sources and destinations.

Also add documentation for normalisation. Prerequisite to actually releasing 0.21.0-alpha.
2021-04-21 11:35:08 +08:00
Davin Chia
b468c39481 Explicitly build the images to get the tests to pass for now. (#2961)
* Explicitly build the images to get the tests to pass for now.

* Fix NPE and add better logging.
2021-04-20 10:58:43 +08:00
Davin Chia
b9014acfca :tada Namespace support. Supported source-destination pairs will now sync data into the same namespace as the source. (#2862)
This PR introduces the following behavior for JDBC sources:
Instead of streamName = schema.tableName,  this is now streamName = tableName and namespace = schema. This means that, when replicating from these sources, data will be replicated into a form matching the source. e.g. public.users (postgres source) -> public.users (postgres destination) instead of current behaviour of public.public_users. Since MySQL does not have schemas, the MySQL source uses the database as it's namespace.

To do so:
- Make namespace a field class concept in Airbyte Protocol. This allows the source to propagate namespace and destinations to write to a source-defined namespace. Also sets us up for future namespace related configurability.
- Add an optional namespace field to the AirbyteRecordMessage. This field will be set by sources that support namespace.
- Introduce AirbyteStreamNameNamespacePair as a type-safe manner of identifying streams throughout our code base.
- Modify base_normalisation to better support source defined namespace, specifically allowing normalisation of tables with the same name to different schemas.
2021-04-17 15:33:22 +08:00
Marcos Marx
ca8f304f90 Add SSL option for Postgres source/destination (#2757)
* add ssl for source-postgres

* add config in utf8 test

* correct comments from @jrhizor and @sherifnada

* correct config get

* add ssl test postgres

* add sh generate ssl files

* change pg ssl test

* use custom image

* correct spec.json

* correc tests

* remove unecessary config

* add config and correct spec.json

* add ssl to postgres destination

* add tools to generate custom dockers images and correct spec.json

* change how additional parameter is append

* add logic ssl for postgres destination

* remove if for append add params

* gradlew format
2021-04-16 15:37:55 -07:00
Davin Chia
9f16651840 Add Namespace Field. (#2704)
Add namespace field to the Airbyte Stream in preparation to propagate a source defined namespace to the Destination.

This namespace field is then consumed as the destination schema the table is written to.

This only applies to JDBC destinations.

This is Steps 1 - 4 of the namespace tech spec, seen at https://docs.google.com/document/d/1qFk4YqnwxE4MCGeJ9M2scGOYej6JnDy9A0zbICP_zjI/edit.

Some minor refactoring and commenting as I go.
* Remove unnecessary test classes as they match Integration tests in terms of what is being tested. They have no real value since the corresponding integration test can be run locally without additional credentials. The main value the classes brings is letting us run tests without building the docker image (the integration tests require doing so). however I feel this benefit is not worth the additional maintenance cost.
* Centralise DataArgumentProvider into it's own class for easier maintenance and usability.
2021-04-06 11:50:47 +08:00
Christophe Duong
6c6ea54bb8 Add SupportedDestinationSyncModes to destination specs objects (#2668)
* Add SupportedDestinationSyncModes to destination specs objects

* Bumpversions of destination connectors
2021-03-31 15:20:01 +02:00
Davin Chia
51ee38845b Refine Destination Interfaces (#2637)
Clean up Destination interfaces, with the goal of less repeated code and hopefully better readability for the next person.

* Rename the write method in the Destination interface to getConsumer to better reflect that the method is not writing itself, but returning a consumer that will write upon accepting a message. This was consuming me when I was reading the code.
* Remove generics from the FailureTrackingConsumer and the DestinationConsumer. Besides tests, there are no generic uses of the FaliureTrackingConsumer. Replace this with the AirbyteMessage to make explicit this is what the FailureTrackingConsumer use cases. Although this does restrict our future use of the FailureTrackingConsumer class, I'd rather limit this now and re-inject generics once we have more use cases. This was also confusing me - I kept on wondering what other data type can be consuming this interface.
* Rename FailureTrackingConsumer to FailureTrackingAirbyteMessageConsumer to better reflect how the consumer is meant to be used strictly as a DestinationConsumer (it implements the interface).
* Rename DestinationConsumer to AirbyteMessageConsumer.

In a subsequent PR, I plan to consolidate logic to error if the received Airbyte message is not of Record type, into the 
FailureTrackingAirbyteMessageConsumer class.
2021-03-30 13:30:15 +08:00
Davin Chia
e8190ff860 🎉 Add NCHAR and NVCHAR support to DB and cursor type casting. (#2600) 2021-03-29 08:09:06 +08:00
Christophe Duong
8a29584125 ☝🏼Destinations supports destination sync mode (#2460)
* Handle destination sync mode in destinations

* Source & Destination sync modes are required (#2500)

* Provide Migration script making sure it is always defined for previous sync configs
2021-03-26 20:23:48 +01:00
Christophe Duong
070575ffdf Protocol allows future / unknown properties (#2238)
* Allow new extra properties in validation
* Create migration script to upgrade all connectors versions
* Bumpversion of all connectors
2021-03-09 13:36:36 +01:00
Christophe Duong
d799b45970 Refactor Normalization to handle nested Streams in new Catalog API (#2044) 2021-02-15 13:50:08 -08:00
Charles
285c176a93 remove naming transformer from destination interface (#1953) 2021-02-04 15:46:53 -08:00
Sherif A. Nada
45f367768a Write a temporary table to verify write permissions when checking destination JDBC credentials (#1834) 2021-01-25 18:53:13 -08:00
Christophe Duong
1cf11688c4 Make schema required for postgres and redshift destination #1789 (#1823) 2021-01-25 20:41:57 +01:00
Jared Rhizor
227e709a48 add postgres (source and destination) field titles (#1765)
* add postgres titles

* fix other conflict

* fix other usage
2021-01-25 10:48:56 -08:00
Christophe Duong
7a741d24b9 Disable ExtendedNameTransformer and use StandardNameTransformer instead (#1786)
* Disable ExtendedNameTransformer and use StandardNameTransformer instead

* Fix acceptance test
2021-01-22 20:53:12 +01:00
Charles
451846ccaf add more logging to jdbc destination (#1775) 2021-01-21 16:37:16 -08:00
Charles
6c5d1b2340 Assert Best Practices for JdbcDestinations (#1680) 2021-01-21 14:12:04 -08:00
Christophe Duong
ebc24f85fe Rename destination tables (#1737) 2021-01-20 17:37:00 +01:00
Charles
3670545995 Fix JdbcSource handling of tables with same names in different schemas (#1724)
* Fix JdbcSource handling of tables with same names in different schemas

* Previously the JdbcSource was combining the columns of any tables with the same name across different schemas into a single stream in the catalog.

* This was caught because in those tables there were columns of the same name with different types which triggered a precondition to check for this.

* The fix makes sure we group by both schema name and table name.

* Adds test to the standard jdbc tests to catch this case.

* This test does NOT run for mysql as, mysql has no concept of schemas.
2021-01-19 18:45:53 -08:00
Christophe Duong
194d6cb5d0 Add metadata prefix to destination internal columns (#1708)
* Add metadata prefix to destination internal columns

* Bumpversion all destinations for new normalization behavior

* Fix acceptance tests
2021-01-19 17:21:15 +01:00
Christophe Duong
15a6acda70 BumpVersions of destinations to release latest fixes (docs etc) #1666 (#1667) 2021-01-19 10:06:16 +01:00