-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd4393c
commit e610db7
Showing
14 changed files
with
287 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
dependencies { | ||
api project(':airbyte-cdk:bulk:toolkits:bulk-cdk-toolkit-load-object-storage') | ||
api project(':airbyte-cdk:bulk:toolkits:bulk-cdk-toolkit-load-s3') | ||
|
||
implementation project(':airbyte-cdk:bulk:core:bulk-cdk-core-base') | ||
implementation project(':airbyte-cdk:bulk:core:bulk-cdk-core-load') | ||
api 'org.apache.iceberg:iceberg-core:1.6.1' | ||
api 'org.apache.iceberg:iceberg-api:1.6.1' | ||
api 'org.apache.iceberg:iceberg-parquet:1.6.1' | ||
api 'org.apache.iceberg:iceberg-nessie:1.6.1' | ||
|
||
testFixturesImplementation testFixtures(project(":airbyte-cdk:bulk:core:bulk-cdk-core-load")) | ||
} |
86 changes: 86 additions & 0 deletions
86
...src/main/kotlin/io/airbyte/cdk/load/command/iceberg/parquet/NessieServerSpecifications.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,86 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.load.command.iceberg.parquet | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription | ||
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaInject | ||
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaTitle | ||
|
||
/** | ||
* Interface defining specifications for connecting to a Nessie server. This includes details such | ||
* as server URI, authentication tokens, and repository settings. | ||
*/ | ||
interface NessieServerSpecifications { | ||
|
||
/** | ||
* The URI of the Nessie server. | ||
* | ||
* This field is required and specifies the base URL used to connect to the Nessie server. | ||
* Example: `https://nessie-server.example.com` | ||
*/ | ||
@get:JsonSchemaTitle("Nessie Server URI") | ||
@get:JsonPropertyDescription( | ||
"The URI of the Nessie server, required to establish a connection." | ||
) | ||
@get:JsonProperty("server_uri") | ||
val serverUri: String | ||
|
||
/** | ||
* Access token for authenticating with the Nessie server. | ||
* | ||
* This field is optional and can be used for secure authentication. Example: | ||
* `a012345678910ABCDEFGH/AbCdEfGhEXAMPLEKEY` | ||
*/ | ||
@get:JsonSchemaTitle("Nessie Access Token") | ||
@get:JsonPropertyDescription("Optional token for authenticating with the Nessie server.") | ||
@get:JsonProperty("access_token") | ||
@get:JsonSchemaInject( | ||
json = | ||
"""{ | ||
"examples": ["a012345678910ABCDEFGH/AbCdEfGhEXAMPLEKEY"], | ||
"airbyte_secret": true | ||
}""", | ||
) | ||
val accessToken: String? | ||
|
||
/** | ||
* The warehouse location for the Nessie server. | ||
* | ||
* Specifies the physical or logical location of the data warehouse managed by Nessie. Example: | ||
* `s3://my-bucket/warehouse/` | ||
*/ | ||
@get:JsonSchemaTitle("Nessie Warehouse Location") | ||
@get:JsonPropertyDescription( | ||
"The location of the data warehouse associated with the Nessie repository." | ||
) | ||
@get:JsonProperty("warehouse_location") | ||
val warehouseLocation: String | ||
|
||
/** | ||
* The name of the main branch in the Nessie repository. | ||
* | ||
* Specifies the default or primary branch name in the Nessie repository. Example: `main` | ||
*/ | ||
@get:JsonSchemaTitle("Nessie Main Branch Name") | ||
@get:JsonPropertyDescription("The name of the main branch in the Nessie repository.") | ||
@get:JsonProperty("main_branch_name") | ||
val mainBranchName: String | ||
|
||
fun toNessieServerConfiguration(): NessieServerConfiguration { | ||
return NessieServerConfiguration(serverUri, accessToken, warehouseLocation, mainBranchName) | ||
} | ||
} | ||
|
||
data class NessieServerConfiguration( | ||
val serverUri: String, | ||
val accessToken: String?, | ||
val warehouseLocation: String, | ||
val mainBranchName: String | ||
) | ||
|
||
interface NessieServerConfigurationProvider { | ||
val nessieServerConfiguration: NessieServerConfiguration | ||
} |
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
49 changes: 49 additions & 0 deletions
49
.../src/main/kotlin/io/airbyte/integrations/destination/iceberg/v2/IcebergV2Configuration.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,49 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.destination.iceberg.v2 | ||
|
||
import io.airbyte.cdk.load.command.DestinationConfiguration | ||
import io.airbyte.cdk.load.command.DestinationConfigurationFactory | ||
import io.airbyte.cdk.load.command.aws.AWSAccessKeyConfiguration | ||
import io.airbyte.cdk.load.command.aws.AWSAccessKeyConfigurationProvider | ||
import io.airbyte.cdk.load.command.iceberg.parquet.NessieServerConfiguration | ||
import io.airbyte.cdk.load.command.iceberg.parquet.NessieServerConfigurationProvider | ||
import io.airbyte.cdk.load.command.s3.S3BucketConfiguration | ||
import io.airbyte.cdk.load.command.s3.S3BucketConfigurationProvider | ||
import io.micronaut.context.annotation.Factory | ||
import jakarta.inject.Singleton | ||
|
||
data class IcebergV2Configuration( | ||
override val awsAccessKeyConfiguration: AWSAccessKeyConfiguration, | ||
override val nessieServerConfiguration: NessieServerConfiguration, | ||
override val s3BucketConfiguration: S3BucketConfiguration | ||
) : | ||
DestinationConfiguration(), | ||
AWSAccessKeyConfigurationProvider, | ||
NessieServerConfigurationProvider, | ||
S3BucketConfigurationProvider | ||
|
||
@Singleton | ||
class IcebergV2ConfigurationFactory : | ||
DestinationConfigurationFactory<IcebergV2Specification, IcebergV2Configuration> { | ||
override fun makeWithoutExceptionHandling( | ||
pojo: IcebergV2Specification | ||
): IcebergV2Configuration { | ||
return IcebergV2Configuration( | ||
awsAccessKeyConfiguration = pojo.toAWSAccessKeyConfiguration(), | ||
s3BucketConfiguration = pojo.toS3BucketConfiguration(), | ||
nessieServerConfiguration = pojo.toNessieServerConfiguration(), | ||
) | ||
} | ||
} | ||
|
||
@Suppress("UNCHECKED_CAST") | ||
@Factory | ||
class IcebergV2ConfigurationProvider(private val config: DestinationConfiguration) { | ||
@Singleton | ||
fun get(): IcebergV2Configuration { | ||
return config as IcebergV2Configuration | ||
} | ||
} |
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
25 changes: 0 additions & 25 deletions
25
.../src/main/kotlin/io/airbyte/integrations/destination/iceberg_v2/IcebergV2Configuration.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.