in flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlProducer.java [229:280]
default void getStream(CallContext context, Ticket ticket, ServerStreamListener listener) {
final Any command;
try {
command = Any.parseFrom(ticket.getBytes());
} catch (InvalidProtocolBufferException e) {
listener.error(e);
return;
}
if (command.is(TicketStatementQuery.class)) {
getStreamStatement(
FlightSqlUtils.unpackOrThrow(command, TicketStatementQuery.class), context, listener);
} else if (command.is(CommandPreparedStatementQuery.class)) {
getStreamPreparedStatement(
FlightSqlUtils.unpackOrThrow(command, CommandPreparedStatementQuery.class),
context,
listener);
} else if (command.is(CommandGetCatalogs.class)) {
getStreamCatalogs(context, listener);
} else if (command.is(CommandGetDbSchemas.class)) {
getStreamSchemas(
FlightSqlUtils.unpackOrThrow(command, CommandGetDbSchemas.class), context, listener);
} else if (command.is(CommandGetTables.class)) {
getStreamTables(
FlightSqlUtils.unpackOrThrow(command, CommandGetTables.class), context, listener);
} else if (command.is(CommandGetTableTypes.class)) {
getStreamTableTypes(context, listener);
} else if (command.is(CommandGetSqlInfo.class)) {
getStreamSqlInfo(
FlightSqlUtils.unpackOrThrow(command, CommandGetSqlInfo.class), context, listener);
} else if (command.is(CommandGetPrimaryKeys.class)) {
getStreamPrimaryKeys(
FlightSqlUtils.unpackOrThrow(command, CommandGetPrimaryKeys.class), context, listener);
} else if (command.is(CommandGetExportedKeys.class)) {
getStreamExportedKeys(
FlightSqlUtils.unpackOrThrow(command, CommandGetExportedKeys.class), context, listener);
} else if (command.is(CommandGetImportedKeys.class)) {
getStreamImportedKeys(
FlightSqlUtils.unpackOrThrow(command, CommandGetImportedKeys.class), context, listener);
} else if (command.is(CommandGetCrossReference.class)) {
getStreamCrossReference(
FlightSqlUtils.unpackOrThrow(command, CommandGetCrossReference.class), context, listener);
} else if (command.is(CommandGetXdbcTypeInfo.class)) {
getStreamTypeInfo(
FlightSqlUtils.unpackOrThrow(command, CommandGetXdbcTypeInfo.class), context, listener);
} else {
throw CallStatus.INVALID_ARGUMENT
.withDescription("The defined request is invalid.")
.toRuntimeException();
}
}