Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Dec 25, 2024
1 parent 219c21f commit e65ff56
Showing 1 changed file with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand All @@ -519,15 +507,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 = 1;
for (int i = 0; i < tablesCount; 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 ByteArrayOutputStream columnOutputStream = new ByteArrayOutputStream();
schemaVector.setSafe(i, columnOutputStream.toByteArray());
}

// final int tablesCount = getTablesResp.getTablesCount();
Expand Down

0 comments on commit e65ff56

Please sign in to comment.