dailai commented on code in PR #6833:
URL: https://github.com/apache/seatunnel/pull/6833#discussion_r1601138392
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-paimon-e2e/src/test/java/org/apache/seatunnel/e2e/connector/paimon/PaimonSinkHdfsIT.java:
##########
@@ -124,4 +149,50 @@ public void testFakeCDCSinkPaimon(TestContainer container)
throws Exception {
});
});
}
+
+ @TestTemplate
+ public void testFakeCDCSinkPaimonWithHiveCatalog(TestContainer container)
throws Exception {
+ Container.ExecResult execResult =
+
container.executeJob("/fake_cdc_sink_paimon_with_hdfs_with_hive_catalog.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+
+ given().ignoreExceptions()
+ .await()
+ .atLeast(200L, TimeUnit.MILLISECONDS)
+ .atMost(40L, TimeUnit.SECONDS)
+ .untilAsserted(
+ () -> {
+ PaimonSinkConfig paimonSinkConfig =
+ new PaimonSinkConfig(
+
ReadonlyConfig.fromMap(PAIMON_SINK_PROPERTIES));
+ PaimonCatalogLoader paimonCatalogLoader =
+ new PaimonCatalogLoader(paimonSinkConfig);
+ Catalog catalog =
paimonCatalogLoader.loadCatalog();
+ Table table =
+ catalog.getTable(
+
Identifier.create("seatunnel_namespace1", "st_test"));
+ ReadBuilder readBuilder = table.newReadBuilder();
+ TableScan.Plan plan = readBuilder.newScan().plan();
+ TableRead tableRead = readBuilder.newRead();
+ List<PaimonRecord> paimonRecords = new
ArrayList<>();
+ try (RecordReader<InternalRow> reader =
tableRead.createReader(plan)) {
+ reader.forEachRemaining(
+ row ->
+ paimonRecords.add(
+ new PaimonRecord(
+ row.getLong(0),
+
row.getString(1).toString())));
+ }
+ Assertions.assertEquals(2, paimonRecords.size());
+ paimonRecords.forEach(
+ paimonRecord -> {
+ if (paimonRecord.getPkId() == 1) {
Review Comment:
It's already exits.
org.apache.seatunnel.e2e.connector.paimon.PaimonIT#testWriteAndReadPaimon.
--
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]