1
0
mirror of synced 2025-12-21 11:01:41 -05:00
Commit Graph

97 Commits

Author SHA1 Message Date
Andrii Leonets
58e4ef6912 Enable SPEC SAT for Java sources (#18779)
* enable py spec compatibility tests

* add missing properties

* use expected spec file instead of the source spec.json + use dummy config file

* add missing files for the clickhouse

* move test files to the integration-test from the unit test folder

* add missing files to cockroachdb

* add missing files to db2 + fix spec format

* add missing files to elasticsearch + fix spec format

* add missing files to jdbc

* add missing files to mongodb_v2 + fix spec format

* add missing files to mssql + fix spec format

* add missing files to mysql + fix spec format

* add missing files to postgres + fix spec format

* add missing files to oracle + fix spec format

* add missing files to redshift

* add missing files to sftp

* add missing files to snowflake + fix spec format

* add missing files to tidb

* add missing files to kafka - fix spec format

* airbyte-source-acceptance-test added

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>

* add missing import

* Delete acceptance-test-config.yml

* Delete acceptance-test-docker.sh

* Update build.gradle

* Update build.gradle

* format

* revert changes

* manual .sh files format

* upd expected spec

* format

* fix SAT after master merge

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Co-authored-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-11-09 21:45:46 +02:00
Eugene
a4ea907094 Fixed checkstyle by running the "./gradlew --no-daemon format --scan". NO changes in logic (#19214)
* Fixed checkstyle by running the "./gradlew --no-daemon format --scan". NO changes in logic
2022-11-09 19:36:37 +02:00
Liren Tu
6967d146ec 🎉 Source redshift & bigquery: emit cursor count in state (#18954)
* Bump version for redshift, bigquery, and snowflake

* auto-bump connector version

* auto-bump connector version

* Log failed refresh token response

* Revert snowflake version bump

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-11-04 01:13:02 -07:00
Akash Kulkarni
5b0ed4fd45 Code cleanup in abstract classes (#18811)
* Refactor attempt 1

Increasing readability:
- Performed audit of methods that are marked as public/protected but should be private
- Performed audit of methods that are marked as public but should be protected
- Removing @Override from methods that don't need them (are the very first)

* Remove .sqlite files

* Remove AbstractRelationDbSource class

- Removing AbstractRelationalDbSource abstract class and moving contents of it to a Util class

* Rename utility class

* Add overrides back
2022-11-03 13:05:56 -07:00
Liren Tu
888347a0d0 🎉 JDBC sources: store cursor record count in db state (#15535)
* Add cursor_record_count to db stream state

* Add cursor record count to cursor info

* Emit max cursor record count

* Add original cursor record count

* Unify logging format

* Add backward compatible methods

* Update unit tests for state decorating iterator

* Update test (not done yet)

* Fix one more unit test

* Change where clause operator according to record count

* Add branch for null cursor

* Skip saving record count when it is 0

* Fix log wording

* Set mock record count in test

* Check cursor value instead of cursor info

* Fix source jdbc test

* Read record count from state

* Fix tests

* Add an acceptance test case

* Fix npe

* Change record count from int to long to avoid type conversion

* Fix references

* Fix oracle container

* Use uppercase for snowflake

* Use uppercase for db2

* Fix and use uppercase

* Update test case to include the edge case

* Format code

* Remove extra assertion in clickhouse

* Merge ms sql incremental query method

* Log query for debugging

* Clean up name_and_timestamp table

* Fix db2 tests

* Fix mssql tests

* Fix oracle tests

* Fix oracle tests

* Fix cockroachdb tests

* Fix snowflake tests

* Add changelog

* Fix mssql tests

* Fix db2-strict-encrypt tests

* Fix oracle-strict-encrypt tests

* Bump postgres version

* Fix oracle-strict-encrypt tests

* auto-bump connector version [ci skip]

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-10-14 01:09:12 -07:00
Pedro S. Lopez
938436bcc9 update connector specs and definitions with new .com documentation urls (#17585)
* update definitions with new .com docs urls

* update docs urls in specs

* update generators

* regenerate scaffold connectors

* remove unrelated changes

* update more urls

* update specs

* fix tests

* run `:airbyte-config:specs:generateSeedConnectorSpecs` to fix formatting

* revert docs changes to make pr more reviewable

* revert generator readme changes to make more reviewable

* fix mysql strict encrypt expected spec

* fix postgres expected spec
2022-10-11 11:04:23 -04:00
Oleksandr Sheheda
6465aae0dc [16617] Source BigQuery: added user agent header (#16902)
* [16617] Source BigQuery: added user agent header

* [16617] Source BigQuery: added user agent header

* [16617] Source BigQuery: added user agent header
updated image tag, added changelog

* [16617] Source BigQuery: added user agent header
fixed NPE

* auto-bump connector version [ci skip]

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-09-22 21:45:06 +03:00
Yurii Bidiuk
10e4aae891 Use LOG4J2 to wrap connectors logs to JSON format (#15668)
* Use LOG4J2 to wrap connectors logs to JSON format

* log connector's stack trace directly as a message

* add stack_trace field to json template

* bump versions

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* revert versions for destinations: postgres, mssql, mysql

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-09-14 23:27:13 +03:00
Subodh Kant Chaturvedi
59dd5e768a fix compilation error with cursor type method (#16635)
* fix compilation error with cursor type method

* fix error for bigquery as well
2022-09-13 21:27:23 +05:30
Liren Tu
fc0bda7f2b 🎉 Postgres source: emit state messages more frequently for incremental sync (#14903)
* Add order by clause in incremental query

* Support emitting intermediate states

* Add comment

* Log state warning only for final state emission

* Format code

* Add unit tests

* Define message iterator in each test case

* Fix compilation error
2022-08-03 12:38:02 -07:00
Edward Gao
b2dd470d3d Handle ints and longs in normalization (#14362)
* generate airbyte_type:integer

* normalization accepts `airbyte_type: integer`

* handles ints+longs

* update avro for consistency

* delete long type for now, treat all ints as longs

* update avro type mappings

{type:number, airbyte_type:integer} -> long
{type:number, airbyte_type:big_integer} -> string (i.e. "unbounded integer")

* fix test

* remove long handling

* Revert "remove long handling"

This reverts commit 33ade8d2831e675c3545ac6019d200ec312e54d9.

* Revert "update avro type mappings"

This reverts commit 5b0349badad7545efe8e1191291a628445fe1c84.

* Revert "delete long type for now, treat all ints as longs"

This reverts commit 018efd4a5d0c59f392fd8e3b0d0967c666b72947.

* Revert "update avro for consistency"

This reverts commit bcf47c6799b5906deb4f219d7f6e64ea73b41b74.

* newline@eof

* update test

* slightly better local tests

* fix test

* missed a few cases

* postgres tests use correct hostnames

* fix normalization

* fix int macro

* add test case

* normalization test output

* handle int/long correctly

* fix types for other DBs

* uint32 -> bigint; tests

* add type value assertions

* more test updates

* regenerate output

* reconcile big_integer to match docs

* update comment

* fix type

* fix mysql constructor call

* bigint only has 38 digits

* fix s3 ints, fix DAT test case

* big_integer should be string

* reduce to 28 digit big_ints

* fix test setup, mysql

* kill big_integer tests

* regenerate output

* version bumps

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-07-26 16:40:14 -07:00
VitaliiMaltsev
df445713aa Remove additionalProperties from JDBC source connectors (#14574)
* Remove additional properties from JDBC specs

* fixed SnowflakeSourceAuthAcceptanceTest

* fixed OracleStrictEncryptJdbcSourceAcceptanceTest

* fixed Oracle Strict encrypt expected spec

* updated Changelog

* fixed CockroachDbSourceTest

* fixed CockroachDb Tests

* fixed CockroachDb Tests for Linux OS

* bump versions

* bump clickhouse-source-strict-encrypt

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* fixed dependencies for Clickhouse Source

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* auto-bump connector version [ci skip]

* fixed OracleSourceDatatypeTest

* auto-bump connector version [ci skip]

* rollback ClickHouse Source changelog

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-07-21 11:01:34 +03:00
George Claireaux
c5783aa799 connectors that published (#13932) 2022-06-20 12:42:56 +01:00
Serhii Chvaliuk
2daaf5b4c3 Normalization - BigQuery use json_extract_string_array for array of simple types (#13289)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Co-authored-by: andrii.leonets <aleonets@gmail.com>
Co-authored-by: Andrii Leonets <30464745+DoNotPanicUA@users.noreply.github.com>
2022-06-10 23:31:32 +03:00
Davin Chia
83a89aa843 Fat Jar: Rename Dir Part 1 (#13476)
Part 1 of #13122.

Rename airbyte-db:lib to airbyte-db:db-lib.
Rename airbyte-metrics:lib to airbyte-metrics:metrics-lib
Rename airbyte-protocol:models to airbyte-protocol:protocol-models.

Explanation for what is happening:

Identically named subprojects have the following issues:
- publishing as is leads to classpath confusion when the jars with the same names are placed in the Java distribution. This leads to NoClassDefFound errors on runtime.
- deconflicting the jar names without changing directory names leads to dependency errors as the OSS jar pom files are generated using project dependencies (suggesting a dependency a sibling subproject in the same repo) that use subprojects group and name as a reference. This means the generated jars look for Jars that do not exists (as their names have been changed) and cannot compile.
- the workaround to changing a subproject's name involves resetting the subproject's name in the settings.gradle and depending on the new name in each build.gradle. This increases configuration burden and decreases the ease of reading, since one will have to check the settings.gradle to know what the right subproject name is. See Projects with same name lead to unintended conflict resolution gradle/gradle#847 for more info.
- given that Gradle itself doesn't have support for identically named subprojects (see the linked issue), the simplest solution is to not allow duplicated directories. I've only renamed conflicting directories here to keep things simple. I will create a follow up issues to enforce non-identical subproject names in our builds.
2022-06-06 00:35:43 +08:00
Alexandre Girard
3894134d11 Bump year in license short to 2022 (#13191)
* Bump to 2022

* format
2022-05-25 17:56:49 -07:00
Topher Lubaway
013a886f4f Fixes Spotless and runs spotless (#13040)
zipped files with JSON extension made this task sad
2022-05-20 07:26:55 -05:00
Jonathan Pearlin
fdaf335279 Better database connection handling for connectors (#12743)
* Better database connection handling for connectors

* Log connection error

* Properly close connection

* Remove unused method

* Close data source

* Use utility to close data source

* Use utility to close data source

* PR feedback

* Add Databricks driver

* Use driver class enum

* Use correct config

* Ensure config created before use

* Fix failing integration test

* Create DSLContext before use

* Address integration test failures

* Ensure DSLContext is closed

* Fix compile error

* Use correct datasource

* Use correct connection properties

* Close DSLContext

* Close DSLContext

* Fix integration test failures

* Properly close datasource

* Fix compilation issues

* Use existing database object

* Wrap close in try/finally

* Update test

* Wrap close in try/finally

* Ensure DSLContext is created

* Revert change to test

* Use correct data source

* Remove unused import

* More cleanup

* Add missing annotation

* Only initialize data source once

* Remove unused import

* Force testcontainers version

* Fix testcontainer issue

* Fix failing test

* Properly close all data sources

* Clear data sources after closing

* Fix compile error

* Fix compilation error

* Add missing method
2022-05-13 16:28:38 -04:00
Jonathan Pearlin
ebb9f3e1ac Prepare Database Access Layer for Dependency Injection (#12546)
* Prepare database access objects for dependency injection

* Replace duplicate code

* Remove unused imports

* Remove redundant validation call

* Remove unused imports

* Use constants

* Disable fast fail during connection pool initialization

* Remove typo

* Add missing test dependency

* Add missing test dependency

* Add missing test dependency

* Fix issue caused by rebase

* Add method for cloud

* Autoclose DSL context during migration

* Better connection close handling

* Fix typo in dependency

* Fix SpotBugs issue

* React to rebase

* Fix typo

* Update JavaDoc

* Fix database close calls

* Pass configs to getServer

* Fix typo

* Fix call to removed method

* Fix typo

* Use catalog to manage versions

* PR feedback

* Centralize shutdown hook

* Fix rebase issues

* Document test cases

* Document test cases

* Formatting

* Properly close database resources

* Rebase cleanup
2022-05-09 15:26:54 -04:00
mkhokh-33
35005541f9 source-bigquery: escape column names and update google cloud bigquery artifact (#11484)
* source-bigquery: escape column names and update google cloud bigquery artifact

* source-bigquery: escape column names and update google cloud bigquery artifact

* source-bigquery: fix formatting

* source-bigquery: fix review comments

* bump versions

* bump versions source_specs.yaml

* revert bump versions

* fix publish-command.yml

* revert publish-command.yml

* auto-bump connector version

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-04-13 22:58:29 +03:00
Charles
5fde59fdbd add spotbugs (#10522) 2022-03-11 12:05:17 -08:00
Lake Mossman
3d8a0dc048 Add ExitOnOutOfMemoryError to java connectors and bump versions (#10256) 2022-02-14 15:49:15 -08:00
VitaliiMaltsev
e30d8348b2 Change JsonSchemaPrimitive to a class (#9913)
* fix for jdk 17

* add JsonSchemaType class

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix Oracle tests

* fix Redshift tests

* fix Redshift tests

* fix checkstyle

* fix MSSQL tests

* fix cockroachdb tests

* fix checkstyle

* fix checkstyle

* replace star imports

* replace star imports

* replace star imports

* update JsonSchemaType | fixed checkstyle

* Remove unused variables in test

* Fix imports

* Expand imports

* Fix more imports

Co-authored-by: vmaltsev <vitalii.maltsev@globallogic.com>
Co-authored-by: Liren Tu <tuliren.git@outlook.com>
2022-02-14 02:12:37 -08:00
LiRen Tu
a094142825 Format code (#9892) 2022-01-29 19:56:00 -08:00
LiRen Tu
e4661fb92a Remove regex check from Java source acceptance test (#9829)
* Move getRegexTests to python source acceptance test

* Remove unused imports

* Update test template
2022-01-26 17:51:37 -08:00
Serhii Chvaliuk
844dd93122 Use multi-stage builds in dockerfiles to reduce java images (#9077)
* use multi-stage to reduce image size

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2021-12-23 22:27:05 +02:00
Karina Kuznietsova
cbe8da49f3 Update fields in source-connectors specifications: amplitude, apify-dataset, appstore-singer, aws-cloudtrail, azure-table, bigcommerce, bigquery, braintree, cart, chargebee (#8434)
* Titles and Descriptions changes #8364
* bump version, update changelogs

Co-authored-by: Karina <karina.kuznietsova@zazmic.com>
2021-12-23 14:45:08 +02:00
Oleksandr Sheheda
f0a9945f80 Revert "Change copy to add in dockerfiles to reduce container size (#8516)" (#8997)
This reverts commit 8ac2c6f4
2021-12-21 16:01:17 +02:00
Haoran Yu
8ac2c6f4a7 Change copy to add in dockerfiles to reduce container size (#8516)
Co-authored-by: Oleksandr Sheheda <alexandr-shegeda@users.noreply.github.com>
2021-12-16 23:52:59 -03:00
LiRen Tu
6843bc1d1f 🎉 Source MySQL: support all MySQL 8.0 types (#7970)
* Add jdbc compatible layer

* Support routine mysql types

* Format code

* Fix build

* Refactor abstract jdbc source and operation classes

* Update mysql source operations

* Test discover command for mysql

* Remove abstract jdbc compatible source layer

* Format code

* Update template

* Fix more types

* Bump version

* Log original field type

* Update comments

* Bump version in seed
2021-12-11 21:49:32 -08:00
Shahil Mawjee
b79984ab7d Fixed broken link in Source Bigquery spec (#7165) 2021-10-19 13:32:24 -03:00
Charles
ba44f700b9 add final for params, local variables, and fields (#7084) 2021-10-15 16:41:04 -07:00
Marcos Marx
153c003e4a Marcos/test pr 6524 (#6577)
* handle empty or null data set id

* bump version

Co-authored-by: prasrvenkat <pras@calixa.io>
2021-09-30 14:17:35 -03:00
Prasanna Ram Venkatachalam
2e7bebbd16 handle empty or null data set id (#6524) 2021-09-30 14:17:24 -03:00
Michel Tricot
1773e41e47 Shorten our headers + adds contributors file (#6478) 2021-09-27 10:45:50 -07:00
Brian Muita
9c5572b82c Source BigQuery: Fix NPE when dataset_id isn't provided (#6051)
* Source BigQuery: Fix for NPE when `dataset_id` isn't provided

* changes for an empty `dataset_id` in the configuration
* added changelog
* bumped version

* Source Bigquery: Version should be 0.1.2 🤦‍♂️

* Source BigQuery: Fixed formatting

* Fixes from `./gradlew format` run

* Source Bigquery: Bump version to 0.1.3
2021-09-23 02:40:00 -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
irynakruk
4625d9036a 🐛 BigQuery source: Fix nested structs (#6135)
* Fixed parsing nested Structs

* Update bigquery.md

* Clean up

* Update Dockerfile
2021-09-17 10:08:30 -04:00
Christophe Duong
da34befeea Implement Google Analytics & Google Ads OAuth Flow (#5911)
Co-authored-by: Sherif Nada <snadalive@gmail.com>
2021-09-13 08:37:53 -07:00
irynakruk
ffecc1c9a2 🎉 New source: MongoDb ported to java (#5530)
* New abstraction for NoSql database sources

* New MongoDbSource: partial impl

* Added MongoDataType

* Improved MongoDatabase and fixed read method

* code review changes;

* merge clean up;

* Renamed NoSqlDatabase to AbstractDatabase

* formatter changes;

* code review changes: changed mongodb-new to mongodb-v2; left only new connector info in all docs

* code review changes: changed mongodb-new to mongodb-v2; left only new connector info in all docs

* updated spec.json and toDatabaseConfig() method

* updated doc accordingly to spec.json changes

Co-authored-by: Iryna Kruk <iryna.o.kruk@globallogic.com>
2021-09-09 08:14:16 -04:00
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
Christophe Duong
5ff0d23c3e make source-bigquery compile (#5877) 2021-09-08 11:48:43 +02:00
Sherif A. Nada
86bdb7e16f rename comprehensive test to typetest and add javadocs (#5675) 2021-08-26 16:53:41 -07: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
Subodh Kant Chaturvedi
797445db1d fix source comprehensive test (#5379) 2021-08-16 23:20:56 +05:30
Andrii Leonets
9151d83bcf 🐛 BigQuery source: Fix nested arrays (#4981)
* unfinished jdbcsource separation

* creation AbstactRelation

* Migrate StateManager to new abstract level (JdbcSource -> RelationalSource)

* fix imports

* move configs to Database level + fix MySql source

* make in line jdbc source with a new impl

* Fix ScaffoldJavaJdbcSource template

* rename `AbstractField` to `CommonField`. Now it
s not an abstract class.
+ add default implementation for `AbstractRelationalDbSource.getFullyQualifiedTableName`

* format

* rename generated files in line with their location

* bonus renaming

* move utility methods specific for jdbc source to a proper module

* internal review update

* BigQueryDatabase impl without row transformation

* add Static method for BigQueryDatabase instancing

* remove data type parameter limitation + rename class parameters

* Move DataTypeUtils from jdbs to common + impl basic types BigQueryUtils

* make DB2 in line with new relational abstract classes

* add missing import

* cover all biqquery classes + add type transformation method from StandardSQLTypeName to JsonSchemaPrimitive

* close unused connections

* add table list extract method

* bigquery source connector

* return all tables for a whole project instead of a dataset

* impl incremental fetch

* bigquery source connector

* bigquery source connector

* remove unnecessary databaseid

* add primitive type filtering

* add temporary workaround for test database.

* add dataset location

* fix table info retrieving

* handle dataset config

* Add working comprehensive test without data cases

* minor changes in the source processing

* acceptance tests; discover method fix

* discover method fix

* first comprehensinve test

* Comprehensive tests for the BigQuery source + database timeout config

* bigquery acceptance tests fix; formatting

* fix incremental sync using date, datetime, time and timestamp types

* Implement source checks: basic and dataset

* format

* revert: airbyte_protocol.by

* internal review update

* Add possibility to get list of comprehensive tests in a Markdown table format.

* Update airbyte-integrations/connectors/source-bigquery/src/main/resources/spec.json

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

* review update

* Implement processing for arrays and structures

* format

* added bigquery secrets

* added bigquery secrets

* spec fix

* test configs fix

* extend mapping for Arrays and Structs

* Process nested arrays

* handle arrays of records properly.

* format

* BigQuery source docs

* docs readme update

* hide evidences

* fix changlog order

* Add bigquery to source_defintions yaml

Co-authored-by: heade <danildubinin2@gmail.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2021-07-27 20:27:12 +03:00
Andrii Leonets
4c0d1a0399 🎉 New Source: Big Query (#4457)
New Source: BigQuery
2021-07-22 15:39:37 +03:00