JNSimba commented on code in PR #427:
URL: 
https://github.com/apache/doris-flink-connector/pull/427#discussion_r1677586595


##########
flink-doris-connector/src/main/java/org/apache/doris/flink/source/reader/DorisSourceSplitReader.java:
##########
@@ -69,8 +84,41 @@ private void checkSplitOrStartNext() throws IOException {
             throw new IOException("Cannot fetch from another split - no split 
remaining");
         }
         currentSplitId = nextSplit.splitId();
-        valueReader =
-                new DorisValueReader(nextSplit.getPartitionDefinition(), 
options, readOptions);
+        if (readOptions.getUseFlightSql()) {
+            valueReader =
+                    new DorisFlightValueReader(
+                            nextSplit.getPartitionDefinition(),
+                            options,
+                            readOptions,
+                            backendClient(),
+                            RestService.getSchema(options, readOptions, LOG));
+        } else {
+            valueReader =
+                    new DorisValueReader(nextSplit.getPartitionDefinition(), 
options, readOptions);
+        }
+    }
+
+    private AdbcConnection backendClient() {
+        final Map<String, Object> parameters = new HashMap<>();
+        RootAllocator allocator = new RootAllocator(Integer.MAX_VALUE);
+        FlightSqlDriver driver = new FlightSqlDriver(allocator);
+        String[] split = options.getFenodes().split(":");

Review Comment:
   options.getFenodes() may be a list, such as 127.0.0.1:8030,127.0.0.1:9030



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to