Skip to content

Commit 80fd850

Browse files
committed
Merge branch 'main' into NIFI-15901
2 parents d4666a4 + 2f74b17 commit 80fd850

34 files changed

Lines changed: 203 additions & 65 deletions

File tree

nifi-code-coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<properties>
3030
<ant.version>1.10.17</ant.version>
31-
<mime4j.version>0.8.13</mime4j.version>
31+
<mime4j.version>0.8.14</mime4j.version>
3232
</properties>
3333

3434
<!-- Managed Dependency Versions for referenced modules required based on different parent bundle project -->

nifi-extension-bundles/nifi-aws-bundle/nifi-aws-kinesis/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<dependency>
8383
<groupId>software.amazon.kinesis</groupId>
8484
<artifactId>amazon-kinesis-client</artifactId>
85-
<version>3.4.2</version>
85+
<version>3.4.3</version>
8686
<scope>test</scope>
8787
<exclusions>
8888
<exclusion>

nifi-extension-bundles/nifi-aws-bundle/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
<version>2.10.0-SNAPSHOT</version>
5454
<scope>provided</scope>
5555
</dependency>
56+
<!-- Override httpclient 5.6 from apache5-client -->
57+
<dependency>
58+
<groupId>org.apache.httpcomponents.client5</groupId>
59+
<artifactId>httpclient5</artifactId>
60+
<version>5.6.1</version>
61+
</dependency>
5662
<dependency>
5763
<groupId>software.amazon.awssdk</groupId>
5864
<artifactId>sts</artifactId>

nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@
141141
<dependency>
142142
<groupId>com.microsoft.azure.kusto</groupId>
143143
<artifactId>kusto-data</artifactId>
144-
<version>7.0.6</version>
144+
<version>8.0.1</version>
145145
</dependency>
146146
<dependency>
147147
<groupId>com.microsoft.azure.kusto</groupId>
148148
<artifactId>kusto-ingest</artifactId>
149-
<version>7.0.6</version>
149+
<version>8.0.1</version>
150150
</dependency>
151151
<dependency>
152152
<groupId>com.fasterxml.jackson.core</groupId>

nifi-extension-bundles/nifi-box-bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>com.box</groupId>
4141
<artifactId>box-java-sdk</artifactId>
42-
<version>5.8.0</version>
42+
<version>5.9.0</version>
4343
</dependency>
4444
</dependencies>
4545
</dependencyManagement>

nifi-extension-bundles/nifi-cdc/nifi-cdc-mysql-bundle/nifi-cdc-mysql-processors/src/main/java/org/apache/nifi/cdc/mysql/processors/CaptureChangeMySQL.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,14 +1222,14 @@ protected TableInfo loadTableInfo(TableInfoCacheKey key) throws SQLException {
12221222
if (jdbcConnectionHolder != null) {
12231223

12241224
try (Statement s = getJdbcConnection().createStatement()) {
1225-
s.execute("USE `" + key.getDatabaseName() + "`");
1226-
ResultSet rs = s.executeQuery("SELECT * FROM `" + key.getTableName() + "` LIMIT 0");
1227-
ResultSetMetaData rsmd = rs.getMetaData();
1228-
int numCols = rsmd.getColumnCount();
1229-
List<ColumnDefinition> columnDefinitions = new ArrayList<>();
1230-
for (int i = 1; i <= numCols; i++) {
1225+
final String tableInfoQuery = getTableInfoQuery(s, key);
1226+
final ResultSet rs = s.executeQuery(tableInfoQuery);
1227+
final ResultSetMetaData rsmd = rs.getMetaData();
1228+
final int columnCount = rsmd.getColumnCount();
1229+
final List<ColumnDefinition> columnDefinitions = new ArrayList<>();
1230+
for (int i = 1; i <= columnCount; i++) {
12311231
// Use the column label if it exists, otherwise use the column name. We're not doing aliasing here, but it's better practice.
1232-
String columnLabel = rsmd.getColumnLabel(i);
1232+
final String columnLabel = rsmd.getColumnLabel(i);
12331233
columnDefinitions.add(new ColumnDefinition(rsmd.getColumnType(i), columnLabel != null ? columnLabel : rsmd.getColumnName(i)));
12341234
}
12351235

@@ -1240,6 +1240,12 @@ protected TableInfo loadTableInfo(TableInfoCacheKey key) throws SQLException {
12401240
return tableInfo;
12411241
}
12421242

1243+
protected String getTableInfoQuery(final Statement statement, final TableInfoCacheKey tableInfoCacheKey) throws SQLException {
1244+
final String databaseNameQuoted = statement.enquoteIdentifier(tableInfoCacheKey.getDatabaseName(), true);
1245+
final String tableNameQuoted = statement.enquoteIdentifier(tableInfoCacheKey.getTableName(), true);
1246+
return "SELECT * FROM %s.%s LIMIT 0".formatted(databaseNameQuoted, tableNameQuoted);
1247+
}
1248+
12431249
protected Connection getJdbcConnection() throws SQLException {
12441250
return jdbcConnectionHolder.getConnection();
12451251
}

nifi-extension-bundles/nifi-cdc/nifi-cdc-mysql-bundle/nifi-cdc-mysql-processors/src/test/java/org/apache/nifi/cdc/mysql/processors/CaptureChangeMySQLTest.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
import java.io.Serializable;
6363
import java.security.NoSuchAlgorithmException;
6464
import java.sql.Connection;
65+
import java.sql.SQLException;
66+
import java.sql.Statement;
6567
import java.util.ArrayList;
6668
import java.util.Arrays;
6769
import java.util.BitSet;
@@ -71,6 +73,7 @@
7173
import java.util.Map;
7274
import java.util.Objects;
7375
import java.util.Set;
76+
import java.util.UUID;
7477
import java.util.concurrent.TimeoutException;
7578
import java.util.stream.IntStream;
7679
import javax.net.ssl.SSLContext;
@@ -80,7 +83,9 @@
8083
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
8184
import static org.junit.jupiter.api.Assertions.assertNotNull;
8285
import static org.junit.jupiter.api.Assertions.assertThrows;
86+
import static org.mockito.Mockito.CALLS_REAL_METHODS;
8387
import static org.mockito.Mockito.doReturn;
88+
import static org.mockito.Mockito.mock;
8489
import static org.mockito.Mockito.when;
8590

8691
/**
@@ -122,7 +127,7 @@ public class CaptureChangeMySQLTest {
122127
private static final String TEN = "10";
123128
private static final ObjectMapper MAPPER = new ObjectMapper();
124129

125-
private CaptureChangeMySQL processor;
130+
private MockCaptureChangeMySQL processor;
126131
private TestRunner testRunner;
127132
private MockBinlogClient client;
128133

@@ -1295,6 +1300,22 @@ public void testNormalizeQuery() {
12951300
assertEquals("alter table", processor.normalizeQuery(" /* This is a \n multiline comment test */ alter table"));
12961301
}
12971302

1303+
@Test
1304+
public void testGetTableInfoQuery() throws SQLException {
1305+
final Statement statement = mock(Statement.class, CALLS_REAL_METHODS);
1306+
1307+
final String prefix = UUID.randomUUID().toString();
1308+
final long tableId = 0;
1309+
1310+
final String databaseName = "NiFi 'Quoted' Repository";
1311+
final String tableName = "FlowFile";
1312+
1313+
final TableInfoCacheKey cacheKey = new TableInfoCacheKey(prefix, databaseName, tableName, tableId);
1314+
final String tableInfoQuery = processor.getTableInfoQuery(statement, cacheKey);
1315+
1316+
assertEquals("SELECT * FROM \"NiFi 'Quoted' Repository\".\"FlowFile\" LIMIT 0", tableInfoQuery);
1317+
}
1318+
12981319
@Test
12991320
void testMigration() {
13001321
final Map<String, String> expectedRenamed = Map.ofEntries(
@@ -1349,9 +1370,8 @@ protected BinaryLogClient createBinlogClient(String hostname, int port, String u
13491370

13501371
@Override
13511372
protected TableInfo loadTableInfo(TableInfoCacheKey key) {
1352-
TableInfo tableInfo = cache.computeIfAbsent(key, k -> new TableInfo(k.getDatabaseName(), k.getTableName(), k.getTableId(),
1373+
return cache.computeIfAbsent(key, k -> new TableInfo(k.getDatabaseName(), k.getTableName(), k.getTableId(),
13531374
Collections.singletonList(new ColumnDefinition((byte) -4, "string1"))));
1354-
return tableInfo;
13551375
}
13561376

13571377
@Override

nifi-extension-bundles/nifi-compress-bundle/nifi-compress-processors/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ language governing permissions and limitations under the License. -->
4242
<dependency>
4343
<groupId>com.aayushatharva.brotli4j</groupId>
4444
<artifactId>brotli4j</artifactId>
45-
<version>1.22.0</version>
45+
<version>1.23.0</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>org.tukaani</groupId>

nifi-extension-bundles/nifi-elasticsearch-bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ language governing permissions and limitations under the License. -->
3333
</modules>
3434

3535
<properties>
36-
<elasticsearch.client.version>9.3.3</elasticsearch.client.version>
36+
<elasticsearch.client.version>9.3.4</elasticsearch.client.version>
3737
</properties>
3838

3939
<dependencyManagement>

nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<dependency>
133133
<groupId>com.google.apis</groupId>
134134
<artifactId>google-api-services-drive</artifactId>
135-
<version>v3-rev20260405-2.0.0</version>
135+
<version>v3-rev20260428-2.0.0</version>
136136
</dependency>
137137
<dependency>
138138
<groupId>com.tdunning</groupId>

0 commit comments

Comments
 (0)