DanielLeens commented on PR #10986: URL: https://github.com/apache/seatunnel/pull/10986#issuecomment-6368780276
I prepared a concrete conflict resolution and a small CSV correction for this head. Daniel has read access to the fork, so these are contributor-applied patches; nothing has been pushed. The conflict resolution below is pinned to PR head `1d1397232afc2f41a40af6c5b347c633644f21af` and fetched upstream `dev` `14a27ac26a0a71b56722f86cdf8ec2779094ceaf`. It uses an ordinary merge, so the contributor's existing history is retained. Save the first diff as `conflict-resolution.patch`, then on a clean checkout of that exact PR head: ```bash git fetch https://github.com/apache/seatunnel.git 14a27ac26a0a71b56722f86cdf8ec2779094ceaf git -c merge.conflictStyle=merge merge --no-commit --no-ff 14a27ac26a0a71b56722f86cdf8ec2779094ceaf # The merge is expected to report conflicts. Apply this resolution before committing: git apply --check conflict-resolution.patch git apply conflict-resolution.patch ``` If the head/base or conflict markers differ, resolve against that new version instead of forcing this patch. The parent POM resolution retains **all** newer upstream module registrations and the Azure module. The upstream merge also retains the Azure dist dependency. Only the conflicting POM needs manual resolution. <details><summary>Patch 1: conflict resolution</summary> ```diff --- a/seatunnel-connectors-v2/pom.xml +++ b/seatunnel-connectors-v2/pom.xml @@ -107,9 +107,7 @@ <module>connector-sensorsdata</module> <module>connector-fluss</module> <module>connector-lance</module> -<<<<<<< HEAD <module>connector-azuredataexplorer</module> -======= <module>connector-bigquery</module> <module>connector-edge-socket</module> <module>connector-amazondocumentdb</module> @@ -117,7 +115,6 @@ <module>connector-nats-jetstream</module> <module>connector-firebase</module> <module>connector-websocket</module> ->>>>>>> 14a27ac26a0a71b56722f86cdf8ec2779094ceaf </modules> <dependencyManagement> ``` </details> The second patch fixes the existing embedded-quote corruption: `a"b` must serialize as `"a""b"`, rather than inserting three embedded quote characters. The regression test exercises the full serialized row and verifies quotes, comma/CRLF framing, unchanged plain text, and a null field together. Save it as `csv.patch` and apply after resolving the merge with `git apply --check csv.patch` followed by `git apply csv.patch`. <details><summary>Patch 2: CSV correction and regression test</summary> ```diff diff --git a/seatunnel-connectors-v2/connector-azuredataexplorer/src/main/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializer.java b/seatunnel-connectors-v2/connector-azuredataexplorer/src/main/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializer.java index eb9988165f3..c0061e02e25 100644 --- a/seatunnel-connectors-v2/connector-azuredataexplorer/src/main/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializer.java +++ b/seatunnel-connectors-v2/connector-azuredataexplorer/src/main/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializer.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.seatunnel.azuredataexplorer.serialization; import org.apache.seatunnel.api.table.type.BasicType; @@ -73,7 +90,7 @@ public class AzureDataExplorerRowSerializer { || s.indexOf('"') >= 0 || s.indexOf('\r') >= 0 || s.indexOf('\n') >= 0) { - return "\"" + s.replace("\"", "\"\"\"") + "\""; + return "\"" + s.replace("\"", "\"\"") + "\""; } return s; } diff --git a/seatunnel-connectors-v2/connector-azuredataexplorer/src/test/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializerTest.java b/seatunnel-connectors-v2/connector-azuredataexplorer/src/test/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializerTest.java new file mode 100644 index 00000000000..e157ae02178 --- /dev/null +++ b/seatunnel-connectors-v2/connector-azuredataexplorer/src/test/java/org/apache/seatunnel/azuredataexplorer/serialization/AzureDataExplorerRowSerializerTest.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.azuredataexplorer.serialization; + +import org.apache.seatunnel.api.table.type.BasicType; +import org.apache.seatunnel.api.table.type.SeaTunnelDataType; +import org.apache.seatunnel.api.table.type.SeaTunnelRow; +import org.apache.seatunnel.api.table.type.SeaTunnelRowType; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** Verifies that ADX CSV rows preserve embedded quotes and field boundaries. */ +class AzureDataExplorerRowSerializerTest { + + @Test + void testCsvRowEscapesQuotesAndDelimiters() { + SeaTunnelRowType rowType = + new SeaTunnelRowType( + new String[] {"quoted", "comma", "newline", "plain", "null"}, + new SeaTunnelDataType<?>[] { + BasicType.STRING_TYPE, + BasicType.STRING_TYPE, + BasicType.STRING_TYPE, + BasicType.STRING_TYPE, + BasicType.STRING_TYPE + }); + AzureDataExplorerRowSerializer serializer = new AzureDataExplorerRowSerializer(rowType); + + assertEquals( + "\"a\"\"b\",\"a,b\",\"a\r\nb\",plain,\n", + serializer.toCsvLine( + new SeaTunnelRow(new Object[] {"a\"b", "a,b", "a\r\nb", "plain", null}))); + } +} ``` </details> Validation performed: scoped `./mvnw spotless:apply -nsu -Dmaven.gitcommitid.skip=true -pl seatunnel-connectors-v2/connector-azuredataexplorer` passed; whitespace checks, reverse patch applicability checks and parent-POM XML parsing passed. No compilation, unit tests, integration tests or ADX runtime tests were run locally. These unpushed patches have no CI result. This does not clear the outstanding source-state/discovery review or the `Build` gate, which currently reports workflow-run detection failure (`ACTION_REQUIRED`). There is also a concrete Java 8 compatibility issue still to address: `AzureDataExplorerSourceReader.snapshotState()` calls Java 10 `List.copyOf`. The contributor must finish those items and enable/trigger fork Actions on the resulting head before CI can prove the branch is ready. <!-- daniel-fcp-repair-20261023-pr10986 --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
