diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java index fbf55b0bbc74b32..a6723bf0cf31595 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java @@ -72,12 +72,12 @@ import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.util.AutoCloseables; -import org.apache.arrow.vector.VarBinaryVector; import org.apache.arrow.vector.VarCharVector; import org.apache.arrow.vector.VectorSchemaRoot; import org.apache.arrow.vector.ipc.WriteChannel; import org.apache.arrow.vector.ipc.message.MessageSerializer; import org.apache.arrow.vector.types.pojo.Schema; +import org.apache.arrow.vector.util.Text; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -508,10 +508,8 @@ public void getStreamTables(final CommandGetTables command, final CallContext co // tableToFields = null; // } - final Schema schema = - includeSchema - ? FlightSqlProducer.Schemas.GET_TABLES_SCHEMA - : FlightSqlProducer.Schemas.GET_TABLES_SCHEMA_NO_SCHEMA; + final Schema schema = includeSchema ? FlightSqlProducer.Schemas.GET_TABLES_SCHEMA + : FlightSqlProducer.Schemas.GET_TABLES_SCHEMA_NO_SCHEMA; try (VectorSchemaRoot vectorSchemaRoot = VectorSchemaRoot.create(schema, rootAllocator)) { listener.start(vectorSchemaRoot); @@ -521,7 +519,16 @@ public void getStreamTables(final CommandGetTables command, final CallContext co VarCharVector schemaNameVector = (VarCharVector) vectorSchemaRoot.getVector("db_schema_name"); VarCharVector tableNameVector = (VarCharVector) vectorSchemaRoot.getVector("table_name"); VarCharVector tableTypeVector = (VarCharVector) vectorSchemaRoot.getVector("table_type"); - VarBinaryVector schemaVector = (VarBinaryVector) vectorSchemaRoot.getVector("table_schema"); + // VarBinaryVector schemaVector = (VarBinaryVector) vectorSchemaRoot.getVector("table_schema"); + + final int tablesCount = 0; + for (int i = 0; i < 0; i++) { + catalogNameVector.setNull(i); + schemaNameVector.setSafe(i, new Text("1111")); + tableTypeVector.setSafe(i, new Text("2222")); + tableNameVector.setSafe(i, new Text("3333")); + // schemaVector.setSafe(i, byte[]); + } // final int tablesCount = getTablesResp.getTablesCount(); // final IntStream range = range(0, tablesCount); @@ -547,8 +554,7 @@ public void getStreamTables(final CommandGetTables command, final CallContext co // } // }); - // vectorSchemaRoot.setRowCount(tablesCount); - vectorSchemaRoot.setRowCount(0); + vectorSchemaRoot.setRowCount(tablesCount); listener.putNext(); listener.completed(); }