-
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.
Bulk Load CDK: Preliminary Refactor before adding mappers (#48350)
- Loading branch information
1 parent
6294144
commit e6d3cde
Showing
24 changed files
with
320 additions
and
423 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
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
64 changes: 64 additions & 0 deletions
64
...lk/core/load/src/main/kotlin/io/airbyte/cdk/load/data/AirbyteTypeToAirbyteTypeWithMeta.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,64 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.load.data | ||
|
||
import io.airbyte.cdk.load.message.DestinationRecord | ||
|
||
class AirbyteTypeToAirbyteTypeWithMeta { | ||
fun convert(schema: AirbyteType): ObjectType = | ||
ObjectType( | ||
linkedMapOf( | ||
DestinationRecord.Meta.COLUMN_NAME_AB_RAW_ID to | ||
FieldType(StringType, nullable = false), | ||
DestinationRecord.Meta.COLUMN_NAME_AB_EXTRACTED_AT to | ||
FieldType(IntegerType, nullable = false), | ||
DestinationRecord.Meta.COLUMN_NAME_AB_META to | ||
FieldType( | ||
nullable = false, | ||
type = | ||
ObjectType( | ||
linkedMapOf( | ||
"sync_id" to FieldType(IntegerType, nullable = false), | ||
"changes" to | ||
FieldType( | ||
nullable = false, | ||
type = | ||
ArrayType( | ||
FieldType( | ||
nullable = false, | ||
type = | ||
ObjectType( | ||
linkedMapOf( | ||
"field" to | ||
FieldType( | ||
StringType, | ||
nullable = false | ||
), | ||
"change" to | ||
FieldType( | ||
StringType, | ||
nullable = false | ||
), | ||
"reason" to | ||
FieldType( | ||
StringType, | ||
nullable = false | ||
), | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
), | ||
DestinationRecord.Meta.COLUMN_NAME_AB_GENERATION_ID to | ||
FieldType(IntegerType, nullable = false), | ||
DestinationRecord.Meta.COLUMN_NAME_DATA to FieldType(schema, nullable = false), | ||
) | ||
) | ||
} | ||
|
||
fun AirbyteType.withAirbyteMeta(): ObjectType = AirbyteTypeToAirbyteTypeWithMeta().convert(this) |
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
14 changes: 0 additions & 14 deletions
14
airbyte-cdk/bulk/core/load/src/main/kotlin/io/airbyte/cdk/load/data/NullableToUnionNull.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
Oops, something went wrong.