From ad49546e952161c63b59bd97d080b9f860cdddb4 Mon Sep 17 00:00:00 2001 From: ClownXC Date: Wed, 1 May 2024 08:04:03 +0800 Subject: [PATCH] fix npe --- .../starrocks/client/source/StarRocksBeReadClient.java | 2 +- .../connectors/seatunnel/starrocks/source/StarRocksSource.java | 1 - .../seatunnel/starrocks/source/StarRocksSourceFactory.java | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/source/StarRocksBeReadClient.java b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/source/StarRocksBeReadClient.java index 3f2abcd77660..32356b97e865 100644 --- a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/source/StarRocksBeReadClient.java +++ b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/source/StarRocksBeReadClient.java @@ -91,10 +91,10 @@ public StarRocksBeReadClient(String beNodeInfo, SourceConfig sourceConfig) { } public void openScanner(QueryPartition partition, SeaTunnelRowType seaTunnelRowType) { - this.seaTunnelRowType = seaTunnelRowType; eos.set(false); this.readerOffset = 0; this.rowBatch = null; + this.seaTunnelRowType = seaTunnelRowType; Set tabletIds = partition.getTabletIds(); TScanOpenParams params = new TScanOpenParams(); params.setTablet_ids(new ArrayList<>(tabletIds)); diff --git a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSource.java b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSource.java index 48f20b10745f..a34616e56fdb 100644 --- a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSource.java +++ b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSource.java @@ -33,7 +33,6 @@ public class StarRocksSource implements SeaTunnelSource { - private CatalogTable catalogTable; private SourceConfig sourceConfig; @Override diff --git a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSourceFactory.java b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSourceFactory.java index 81259c05af7a..50fcef909701 100644 --- a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSourceFactory.java +++ b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/source/StarRocksSourceFactory.java @@ -21,8 +21,6 @@ import org.apache.seatunnel.api.configuration.util.OptionRule; import org.apache.seatunnel.api.source.SeaTunnelSource; import org.apache.seatunnel.api.source.SourceSplit; -import org.apache.seatunnel.api.table.catalog.CatalogTable; -import org.apache.seatunnel.api.table.catalog.CatalogTableUtil; import org.apache.seatunnel.api.table.catalog.schema.TableSchemaOptions; import org.apache.seatunnel.api.table.connector.TableSource; import org.apache.seatunnel.api.table.factory.Factory; @@ -74,7 +72,6 @@ public Class getSourceClass() { TableSource createSource(TableSourceFactoryContext context) { ReadonlyConfig config = context.getOptions(); SourceConfig starRocksSourceConfig = new SourceConfig(config); - CatalogTable catalogTable = CatalogTableUtil.buildWithConfig(config); return () -> (SeaTunnelSource) new StarRocksSource(starRocksSourceConfig); }