Skip to content

Commit

Permalink
[FLINK-33440] Update Flink version matrix, add 1.19-SNAPSHOT to GH wo…
Browse files Browse the repository at this point in the history
…rkflows, update flink-connector-parent
  • Loading branch information
ferenc-csaky authored Apr 16, 2024
1 parent 3e7bb17 commit 08b7b69
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 42 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
compile_and_test:
strategy:
matrix:
flink: [1.16.2, 1.17.1, 1.18.0]
flink: [1.16.3, 1.17.2, 1.18.0, 1.19-SNAPSHOT]
uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
with:
flink_version: ${{ matrix.flink }}
timeout_global: 120
timeout_test: 80
timeout_test: 80

12 changes: 6 additions & 6 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ jobs:
strategy:
matrix:
flink_branches: [{
flink: 1.16.2,
flink: 1.16.3,
branch: v3.0
}, {
flink: 1.17.1,
branch: v3.0
}, {
flink: 1.18.0,
flink: 1.17.2,
branch: v3.0
}, {
flink: 1.16-SNAPSHOT,
branch: main
}, {
flink: 1.17-SNAPSHOT,
branch: main
}, {
},{
flink: 1.18-SNAPSHOT,
branch: main
}, {
flink: 1.19-SNAPSHOT,
branch: main
}]
uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
with:
Expand Down
6 changes: 0 additions & 6 deletions flink-connector-hbase-2.2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,6 @@ under the License.
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-minicluster</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,35 @@
import org.apache.flink.table.planner.utils.StreamTableTestUtil;
import org.apache.flink.table.planner.utils.TableTestBase;

import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.rules.TestName;

import static org.apache.flink.core.testutils.FlinkMatchers.containsCause;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/** Plan tests for HBase connector, for example, testing projection push down. */
public class HBaseTablePlanTest extends TableTestBase {

private final StreamTableTestUtil util = streamTestUtil(TableConfig.getDefault());

private TestInfo testInfo;

@BeforeEach
public void setup(TestInfo testInfo) {
this.testInfo = testInfo;
}

// A workaround to get the test method name for Flink versions not completely migrated to JUnit5
public TestName name() {
return new TestName() {
@Override
public String getMethodName() {
return testInfo.getTestMethod().get().getName();
}
};
}

@Test
public void testMultipleRowKey() {
util.tableEnv()
Expand All @@ -45,11 +65,10 @@ public void testMultipleRowKey() {
+ " 'table-name' = 'my_table',"
+ " 'zookeeper.quorum' = 'localhost:2021'"
+ ")");
thrown().expect(
containsCause(
new IllegalArgumentException(
"Row key can't be set multiple times.")));
util.verifyExecPlan("SELECT * FROM hTable");

assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable"))
.hasRootCauseInstanceOf(IllegalArgumentException.class)
.hasRootCauseMessage("Row key can't be set multiple times.");
}

@Test
Expand All @@ -64,13 +83,13 @@ public void testNoneRowKey() {
+ " 'table-name' = 'my_table',"
+ " 'zookeeper.quorum' = 'localhost:2021'"
+ ")");
thrown().expect(
containsCause(
new IllegalArgumentException(
"HBase table requires to define a row key field. "
+ "A row key field is defined as an atomic type, "
+ "column families and qualifiers are defined as ROW type.")));
util.verifyExecPlan("SELECT * FROM hTable");

assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable"))
.hasRootCauseInstanceOf(IllegalArgumentException.class)
.hasRootCauseMessage(
"HBase table requires to define a row key field. "
+ "A row key field is defined as an atomic type, "
+ "column families and qualifiers are defined as ROW type.");
}

@Test
Expand All @@ -87,13 +106,13 @@ public void testInvalidPrimaryKey() {
+ " 'table-name' = 'my_table',"
+ " 'zookeeper.quorum' = 'localhost:2021'"
+ ")");
thrown().expect(
containsCause(
new IllegalArgumentException(
"Primary key of HBase table must be defined on the row key field. "
+ "A row key field is defined as an atomic type, "
+ "column families and qualifiers are defined as ROW type.")));
util.verifyExecPlan("SELECT * FROM hTable");

assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable"))
.hasRootCauseInstanceOf(IllegalArgumentException.class)
.hasRootCauseMessage(
"Primary key of HBase table must be defined on the row key field. "
+ "A row key field is defined as an atomic type, "
+ "column families and qualifiers are defined as ROW type.");
}

@Test
Expand All @@ -111,11 +130,10 @@ public void testUnsupportedDataType() {
+ " 'table-name' = 'my_table',"
+ " 'zookeeper.quorum' = 'localhost:2021'"
+ ")");
thrown().expect(
containsCause(
new IllegalArgumentException(
"Unsupported field type 'ARRAY<STRING>' for HBase.")));
util.verifyExecPlan("SELECT * FROM hTable");

assertThatThrownBy(() -> util.verifyExecPlan("SELECT * FROM hTable"))
.hasRootCauseInstanceOf(IllegalArgumentException.class)
.hasRootCauseMessage("Unsupported field type 'ARRAY<STRING>' for HBase.");
}

@Test
Expand Down
24 changes: 22 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ under the License.
<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-parent</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</parent>

<groupId>org.apache.flink</groupId>
Expand All @@ -53,7 +53,7 @@ under the License.
</scm>

<properties>
<flink.version>1.16.2</flink.version>
<flink.version>1.16.3</flink.version>

<scala.binary.version>2.12</scala.binary.version>
<scala.version>2.12.7</scala.version>
Expand Down Expand Up @@ -190,6 +190,16 @@ under the License.
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils</artifactId>
<version>${flink.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -350,6 +360,10 @@ under the License.
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -510,6 +524,12 @@ under the License.
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>

<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.10.4</version>
</dependency>
<!-- End of dependencies for dependency convergence -->
</dependencies>
</dependencyManagement>
Expand Down

0 comments on commit 08b7b69

Please sign in to comment.