in flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlProducer.java [110:163]
default FlightInfo getFlightInfo(CallContext context, FlightDescriptor descriptor) {
final Any command = FlightSqlUtils.parseOrThrow(descriptor.getCommand());
if (command.is(CommandStatementQuery.class)) {
return getFlightInfoStatement(
FlightSqlUtils.unpackOrThrow(command, CommandStatementQuery.class), context, descriptor);
} else if (command.is(CommandStatementSubstraitPlan.class)) {
return getFlightInfoSubstraitPlan(
FlightSqlUtils.unpackOrThrow(command, CommandStatementSubstraitPlan.class),
context,
descriptor);
} else if (command.is(CommandPreparedStatementQuery.class)) {
return getFlightInfoPreparedStatement(
FlightSqlUtils.unpackOrThrow(command, CommandPreparedStatementQuery.class),
context,
descriptor);
} else if (command.is(CommandGetCatalogs.class)) {
return getFlightInfoCatalogs(
FlightSqlUtils.unpackOrThrow(command, CommandGetCatalogs.class), context, descriptor);
} else if (command.is(CommandGetDbSchemas.class)) {
return getFlightInfoSchemas(
FlightSqlUtils.unpackOrThrow(command, CommandGetDbSchemas.class), context, descriptor);
} else if (command.is(CommandGetTables.class)) {
return getFlightInfoTables(
FlightSqlUtils.unpackOrThrow(command, CommandGetTables.class), context, descriptor);
} else if (command.is(CommandGetTableTypes.class)) {
return getFlightInfoTableTypes(
FlightSqlUtils.unpackOrThrow(command, CommandGetTableTypes.class), context, descriptor);
} else if (command.is(CommandGetSqlInfo.class)) {
return getFlightInfoSqlInfo(
FlightSqlUtils.unpackOrThrow(command, CommandGetSqlInfo.class), context, descriptor);
} else if (command.is(CommandGetPrimaryKeys.class)) {
return getFlightInfoPrimaryKeys(
FlightSqlUtils.unpackOrThrow(command, CommandGetPrimaryKeys.class), context, descriptor);
} else if (command.is(CommandGetExportedKeys.class)) {
return getFlightInfoExportedKeys(
FlightSqlUtils.unpackOrThrow(command, CommandGetExportedKeys.class), context, descriptor);
} else if (command.is(CommandGetImportedKeys.class)) {
return getFlightInfoImportedKeys(
FlightSqlUtils.unpackOrThrow(command, CommandGetImportedKeys.class), context, descriptor);
} else if (command.is(CommandGetCrossReference.class)) {
return getFlightInfoCrossReference(
FlightSqlUtils.unpackOrThrow(command, CommandGetCrossReference.class),
context,
descriptor);
} else if (command.is(CommandGetXdbcTypeInfo.class)) {
return getFlightInfoTypeInfo(
FlightSqlUtils.unpackOrThrow(command, CommandGetXdbcTypeInfo.class), context, descriptor);
}
throw CallStatus.INVALID_ARGUMENT
.withDescription("Unrecognized request: " + command.getTypeUrl())
.toRuntimeException();
}