From 6cdfa7f74c1d3ba02ae606044590c61aa51e68cb Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 15 Feb 2024 15:44:40 +0100 Subject: [PATCH 1/3] Fix parsing ops with spaces after `and` (#2400) --- .../oracle/src/connector/replicate/log_miner/parse/row.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/row.rs b/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/row.rs index e4b109112c..fcafe6a5ed 100644 --- a/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/row.rs +++ b/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/row.rs @@ -14,7 +14,7 @@ pub struct Parser { impl Parser { pub fn new(delimiter: &str, end: &str) -> Self { let regex = Regex::new(&format!( - "\"(\\w+)\" (= (.+)|IS NULL)({}\\n|{})", + "\"(\\w+)\" (= (.+)|IS NULL)({} *\\n|{})", delimiter, end )) .unwrap(); From e59ee4e5d1c446669e3fd199e641fb1ebf45c747 Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 15 Feb 2024 18:00:33 +0100 Subject: [PATCH 2/3] Fix update oracle update parser (#2401) --- .../src/connector/replicate/log_miner/parse/update.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/update.rs b/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/update.rs index aed890f5d5..6dfc799ec7 100644 --- a/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/update.rs +++ b/dozer-ingestion/oracle/src/connector/replicate/log_miner/parse/update.rs @@ -15,7 +15,8 @@ pub struct Parser { impl Parser { pub fn new() -> Self { let regex = - Regex::new(r#"^update "(\w+)"\."(\w+)"\n *(?s)(.+) *where\n(?s)(.+)$"#).unwrap(); + Regex::new(r#"^update "(\w+)"\."(\w+)"\n *set *\n *(?s)(.+) *where *\n(?s)(.+)$"#) + .unwrap(); Self { regex, new_row_parser: row::Parser::new(",", "\n"), @@ -62,9 +63,10 @@ fn test_parse() { let parser = Parser::new(); let sql_redo = r#"update "DOZER"."TRANSACTIONS" + set "TYPE" = 'REBATE' - where - "TRANSACTION_ID" = 12001 and + where + "TRANSACTION_ID" = 12001 and "CUSTOMER_ID" = 63147 and "TYPE" = 'Withdrawal' and "AMOUNT" = 9691.34 and From 32e04b71923f4956fb35f34374565ce0c42195cd Mon Sep 17 00:00:00 2001 From: Jesse Date: Fri, 16 Feb 2024 09:52:17 +0100 Subject: [PATCH 3/3] Send scn when snapshotting is done to allow resuming from there (#2402) --- dozer-ingestion/oracle/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dozer-ingestion/oracle/src/lib.rs b/dozer-ingestion/oracle/src/lib.rs index cbb3ee3cf4..0458fb4555 100644 --- a/dozer-ingestion/oracle/src/lib.rs +++ b/dozer-ingestion/oracle/src/lib.rs @@ -177,7 +177,12 @@ impl Connector for OracleConnector { .unwrap()?; ingestor .handle_message(IngestionMessage::TransactionInfo( - TransactionInfo::SnapshottingDone { id: None }, + TransactionInfo::SnapshottingDone { + id: Some(OpIdentifier { + txid: scn, + seq_in_tx: 0, + }), + }, )) .await?; scn