Skip to content

Commit 8444253

Browse files
authored
Merge branch 'master' into sheinbergon/source-tiktok-marketing-new-streams
2 parents a3dd3f4 + 691f8a8 commit 8444253

File tree

132 files changed

+4833
-4103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+4833
-4103
lines changed

airbyte-cdk/bulk/core/load/src/main/kotlin/io/airbyte/cdk/load/data/AirbyteValue.kt

+77
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import com.fasterxml.jackson.databind.JsonSerializer
1111
import com.fasterxml.jackson.databind.SerializerProvider
1212
import com.fasterxml.jackson.databind.annotation.JsonSerialize
1313
import com.fasterxml.jackson.databind.node.NullNode
14+
import io.airbyte.cdk.load.message.Meta
15+
import io.airbyte.protocol.models.v0.AirbyteRecordMessageMetaChange
16+
import io.airbyte.protocol.models.v0.AirbyteRecordMessageMetaChange.Reason
1417
import java.math.BigDecimal
1518
import java.math.BigInteger
1619
import java.time.LocalDate
@@ -153,3 +156,77 @@ private class ObjectValueSerializer : JsonSerializer<ObjectValue>() {
153156
}
154157

155158
@JvmInline value class UnknownValue(val value: JsonNode) : AirbyteValue
159+
160+
/**
161+
* Represents an "enriched" (/augmented) Airbyte value with additional metadata.
162+
*
163+
* @property value The actual [AirbyteValue]
164+
* @property type The type ([AirbyteType]) of the [AirbyteValue]
165+
* @property changes List of [Meta.Change]s that have been applied to this value
166+
* @property name Field name
167+
* @property fieldCategory [FieldCategory] of the field
168+
*/
169+
data class EnrichedAirbyteValue(
170+
val value: AirbyteValue,
171+
val type: AirbyteType,
172+
val changes: List<Meta.Change> = emptyList(),
173+
val name: String,
174+
val fieldCategory: FieldCategory
175+
) {
176+
init {
177+
require(name.isNotBlank()) { "Field name cannot be blank" }
178+
}
179+
180+
/**
181+
* Creates a nullified version of this value with the specified reason.
182+
*
183+
* @param reason The [Reason] for nullification, defaults to DESTINATION_SERIALIZATION_ERROR
184+
* @return A new [EnrichedAirbyteValue] with a null value and an additional change record
185+
*/
186+
fun toNullified(reason: Reason = Reason.DESTINATION_SERIALIZATION_ERROR): EnrichedAirbyteValue {
187+
val nullChange =
188+
Meta.Change(
189+
field = name,
190+
change = AirbyteRecordMessageMetaChange.Change.NULLED,
191+
reason = reason
192+
)
193+
194+
// Return a copy with null value and the new change added to the changes list
195+
return copy(value = NullValue, changes = changes + nullChange)
196+
}
197+
198+
/**
199+
* Creates a truncated version of this value with the specified reason and new value.
200+
*
201+
* @param reason The [Reason] for truncation, defaults to DESTINATION_RECORD_SIZE_LIMITATION
202+
* @param newValue The new (truncated) value to use
203+
* @return A new [EnrichedAirbyteValue] with the truncated value and an additional change record
204+
*/
205+
fun toTruncated(
206+
reason: Reason = Reason.DESTINATION_RECORD_SIZE_LIMITATION,
207+
newValue: AirbyteValue
208+
): EnrichedAirbyteValue {
209+
val truncateChange =
210+
Meta.Change(
211+
field = name,
212+
change = AirbyteRecordMessageMetaChange.Change.TRUNCATED,
213+
reason = reason
214+
)
215+
216+
// Return a copy with null value and the new change added to the changes list
217+
return copy(value = newValue, changes = changes + truncateChange)
218+
}
219+
}
220+
221+
/**
222+
* The [EnrichedAirbyteValue] category allows us to quickly understand if the field is an Airbyte
223+
* controlled field or if it is declared by the source.
224+
*/
225+
enum class FieldCategory {
226+
RAW_ID,
227+
EXTRACTED_AT,
228+
META,
229+
GENERATION_ID,
230+
// For fields that don't match any of the predefined Airbyte columns
231+
CLIENT_DATA
232+
}

airbyte-integrations/connectors/destination-mssql-strict-encrypt/build.gradle

-39
This file was deleted.

airbyte-integrations/connectors/destination-mssql-strict-encrypt/gradle.properties

-3
This file was deleted.

airbyte-integrations/connectors/destination-mssql-strict-encrypt/icon.svg

-1
This file was deleted.

airbyte-integrations/connectors/destination-mssql-strict-encrypt/metadata.yaml

-38
This file was deleted.

0 commit comments

Comments
 (0)