From e65ff563f155f561d74b6c8b4777645f4681d37c Mon Sep 17 00:00:00 2001 From: Zou Xinyi Date: Wed, 25 Dec 2024 16:58:21 +0800 Subject: [PATCH] 5 --- .../arrowflight/DorisFlightSqlProducer.java | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) 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 986d17589d6d17..96b977502a798f 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,6 +72,7 @@ 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; @@ -479,25 +480,12 @@ public FlightInfo getFlightInfoTables(final CommandGetTables request, final Call @Override public void getStreamTables(final CommandGetTables command, final CallContext context, final ServerStreamListener listener) { - // throw CallStatus.UNIMPLEMENTED.withDescription("getStreamTables unimplemented").toRuntimeException(); try { - // if (commandGetTables.hasDbSchemaFilterPattern()) { - // builder.setSchemaNameFilter( - // UserProtos.LikeFilter.newBuilder() - // .setPattern(command.getDbSchemaFilterPattern()) - // .build()); - // } - // - // if (commandGetTables.hasTableNameFilterPattern()) { - // builder.setTableNameFilter( - // UserProtos.LikeFilter.newBuilder() - // .setPattern(command.getTableNameFilterPattern()) - // .build()); - // } - // - // if (!commandGetTables.getTableTypesList().isEmpty()) { - // builder.addAllTableTypeFilter(command.getTableTypesList()); - // } + // TODO + // command.getDbSchemaFilterPattern(); + // command.getTableNameFilterPattern(); + // command.getTableTypesList(); + // context.isCancelled(); final boolean includeSchema = command.getIncludeSchema(); @@ -519,7 +507,7 @@ 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 = 1; for (int i = 0; i < tablesCount; i++) { @@ -527,7 +515,8 @@ public void getStreamTables(final CommandGetTables command, final CallContext co schemaNameVector.setSafe(i, new Text("1111")); tableTypeVector.setSafe(i, new Text("2222")); tableNameVector.setSafe(i, new Text("3333")); - // schemaVector.setSafe(i, byte[]); + final ByteArrayOutputStream columnOutputStream = new ByteArrayOutputStream(); + schemaVector.setSafe(i, columnOutputStream.toByteArray()); } // final int tablesCount = getTablesResp.getTablesCount();