-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iceberg-schema-supertype-finder' into iceberg-schema-up…
…date-logic
- Loading branch information
Showing
36 changed files
with
2,550 additions
and
393 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
21 changes: 21 additions & 0 deletions
21
airbyte-cdk/bulk/core/load/src/test/kotlin/io/airbyte/cdk/load/data/TransformationsTest.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,21 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.load.data | ||
|
||
import org.junit.jupiter.api.Test | ||
|
||
class TransformationsTest { | ||
@Test | ||
fun `test avro illegal start character`() { | ||
val unsafeName = "1d_view" | ||
assert(Transformations.toAvroSafeName(unsafeName) == "_1d_view") | ||
} | ||
|
||
@Test | ||
fun `test avro special characters`() { | ||
val unsafeName = "1d_view!@#$%^&*()" | ||
assert(Transformations.toAvroSafeName(unsafeName) == "_1d_view__________") | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
airbyte-cdk/bulk/toolkits/load-avro/src/test/kotlin/AirbyteTypeToAvroSchemaTest.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,26 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
import io.airbyte.cdk.load.command.DestinationStream | ||
import io.airbyte.cdk.load.data.FieldType | ||
import io.airbyte.cdk.load.data.ObjectType | ||
import io.airbyte.cdk.load.data.StringType | ||
import io.airbyte.cdk.load.data.avro.toAvroSchema | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.assertDoesNotThrow | ||
|
||
class AirbyteTypeToAvroSchemaTest { | ||
@Test | ||
fun `test name mangling`() { | ||
val schema = | ||
ObjectType( | ||
properties = | ||
linkedMapOf( | ||
"1d_view" to FieldType(type = StringType, nullable = false), | ||
) | ||
) | ||
val descriptor = DestinationStream.Descriptor("test", "stream") | ||
assertDoesNotThrow { schema.toAvroSchema(descriptor) } | ||
} | ||
} |
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
57 changes: 57 additions & 0 deletions
57
...test/kotlin/io/airbyte/cdk/load/write/object_storage/ObjectStorageFormattingWriterTest.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,57 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.load.write.object_storage | ||
|
||
import io.airbyte.cdk.load.file.NoopProcessor | ||
import io.airbyte.cdk.load.file.object_storage.BufferedFormattingWriter | ||
import io.airbyte.cdk.load.file.object_storage.ObjectStorageFormattingWriter | ||
import io.mockk.coEvery | ||
import io.mockk.impl.annotations.MockK | ||
import io.mockk.mockk | ||
import java.io.ByteArrayOutputStream | ||
import org.junit.jupiter.api.Test | ||
|
||
class ObjectStorageFormattingWriterTest { | ||
@MockK(relaxed = true) lateinit var underlyingWriter: ObjectStorageFormattingWriter | ||
|
||
@Test | ||
fun `buffered formatting writer never produces empty parts`() { | ||
val outputStream = ByteArrayOutputStream() | ||
outputStream.write("i am a header".toByteArray()) | ||
val bufferedWriter = | ||
BufferedFormattingWriter( | ||
underlyingWriter, | ||
outputStream, | ||
NoopProcessor, | ||
NoopProcessor.wrapper(outputStream), | ||
) | ||
|
||
assert(bufferedWriter.bufferSize == 0) { "buffer appears empty despite header" } | ||
assert(bufferedWriter.takeBytes() == null) { "buffer yields no data despite header" } | ||
assert(bufferedWriter.finish() == null) { "buffer yields no data despite header" } | ||
} | ||
|
||
@Test | ||
fun `buffered formatting writer yields entire buffer once any data has been added`() { | ||
val outputStream = ByteArrayOutputStream() | ||
outputStream.write("i am a header".toByteArray()) | ||
val bufferedWriter = | ||
BufferedFormattingWriter( | ||
underlyingWriter, | ||
outputStream, | ||
NoopProcessor, | ||
NoopProcessor.wrapper(outputStream), | ||
) | ||
|
||
assert(bufferedWriter.takeBytes() == null) | ||
coEvery { bufferedWriter.accept(any()) } coAnswers { outputStream.write("!".toByteArray()) } | ||
bufferedWriter.accept(mockk()) | ||
val bytes = bufferedWriter.takeBytes() | ||
assert(bytes != null) { "buffer yields data now that we've written to it" } | ||
assert(bytes.contentEquals("i am a header!".toByteArray())) { | ||
"buffer yields all data written to it" | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
airbyte-cdk/java/airbyte-cdk/core/src/main/resources/version.properties
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 +1 @@ | ||
version=0.48.2 | ||
version=0.48.4 |
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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "pipelines" | ||
version = "4.48.0" | ||
version = "4.48.1" | ||
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines" | ||
authors = ["Airbyte <[email protected]>"] | ||
|
||
|
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.