From d539f09619fd9c95ebcc6259330d71edf847655a Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Thu, 3 Aug 2023 10:45:38 +0100 Subject: [PATCH] atf: support wildcard schema patches, apply one for salesforce reduction --- .../connectors/source-salesforce/streams/*.patch.json | 5 +++++ .../src/interceptors/airbyte_source_interceptor.rs | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 airbyte-integrations/connectors/source-salesforce/streams/*.patch.json diff --git a/airbyte-integrations/connectors/source-salesforce/streams/*.patch.json b/airbyte-integrations/connectors/source-salesforce/streams/*.patch.json new file mode 100644 index 000000000000..7e70586c6c52 --- /dev/null +++ b/airbyte-integrations/connectors/source-salesforce/streams/*.patch.json @@ -0,0 +1,5 @@ +{ + "reduce": { + "strategy": "merge" + } +} diff --git a/airbyte-to-flow/src/interceptors/airbyte_source_interceptor.rs b/airbyte-to-flow/src/interceptors/airbyte_source_interceptor.rs index 747c1aebb032..be61d2048819 100644 --- a/airbyte-to-flow/src/interceptors/airbyte_source_interceptor.rs +++ b/airbyte-to-flow/src/interceptors/airbyte_source_interceptor.rs @@ -269,6 +269,12 @@ impl AirbyteSourceInterceptor { "{}/{}{}", STREAM_PATCH_DIR_NAME, recommended_name, STREAM_PATCH_SUFFIX )) + .or_else(|_| { + std::fs::read_to_string(format!( + "{}/*{}", + STREAM_PATCH_DIR_NAME, STREAM_PATCH_SUFFIX + )) + }) .ok() .map(|p| sj::from_str::(&p)) .transpose()?;