-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract-jdbc: refactor constants (#44482)
- Loading branch information
Marius Posta
authored
Aug 21, 2024
1 parent
8ef222b
commit 571a3b6
Showing
84 changed files
with
3,819 additions
and
1,534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
...e-cdk/bulk/core/extract/src/main/kotlin/io/airbyte/cdk/discover/AirbyteStreamDecorator.kt
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
...yte-cdk/bulk/core/extract/src/main/kotlin/io/airbyte/cdk/discover/AirbyteStreamFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* Copyright (c) 2024 Airbyte, Inc., all rights reserved. */ | ||
package io.airbyte.cdk.discover | ||
|
||
import io.airbyte.protocol.models.Field as AirbyteField | ||
import io.airbyte.protocol.models.v0.AirbyteStream | ||
import io.airbyte.protocol.models.v0.CatalogHelpers | ||
|
||
/** Stateless object for building an [AirbyteStream] during DISCOVER. */ | ||
interface AirbyteStreamFactory { | ||
/** Connector-specific [AirbyteStream] creation logic for GLOBAL-state streams. */ | ||
fun createGlobal(discoveredStream: DiscoveredStream): AirbyteStream | ||
|
||
/** Connector-specific [AirbyteStream] creation logic for STREAM-state streams. */ | ||
fun createNonGlobal(discoveredStream: DiscoveredStream): AirbyteStream | ||
|
||
companion object { | ||
|
||
fun createAirbyteStream(discoveredStream: DiscoveredStream): AirbyteStream = | ||
CatalogHelpers.createAirbyteStream( | ||
discoveredStream.name, | ||
discoveredStream.namespace, | ||
discoveredStream.columns.map { | ||
AirbyteField.of(it.id, it.type.airbyteType.asJsonSchemaType()) | ||
}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
airbyte-cdk/bulk/core/extract/src/main/kotlin/io/airbyte/cdk/discover/DiscoveredStream.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.discover | ||
|
||
data class DiscoveredStream( | ||
val name: String, | ||
val namespace: String?, | ||
val columns: List<Field>, | ||
val primaryKeyColumnIDs: List<List<String>>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
airbyte-cdk/bulk/core/extract/src/test/kotlin/io/airbyte/cdk/command/SyncsTestFixtureTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* Copyright (c) 2024 Airbyte, Inc., all rights reserved. */ | ||
package io.airbyte.cdk.command | ||
|
||
import org.junit.jupiter.api.Test | ||
|
||
class SyncsTestFixtureTest { | ||
|
||
@Test | ||
fun testSpec() { | ||
SyncsTestFixture.testSpec("fakesource/expected-spec.json") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.