Update FlightSQL GetDbSchemas and GetTables schemas to fully match the protocol (#7638)

# Which issue does this PR close?

PR updates FlightSQL `GetDbSchemas` and `GetTables` schemas to fully
match the FlightSQL protocol (fields nullability).

Fixes  
- https://github.com/apache/arrow-rs/issues/7637

# Are there any user-facing changes?

It could technically be considered a user-facing breaking change, as the
schema returned by the `CommandGetDbSchemas` and `CommandGetTables`
FlightSQL commands will change. However, since the change only affects
field nullability, there should be no practical impact, or it is very
unlikely.
This commit is contained in:
Sergei Grebnov
2025-06-11 08:40:23 -07:00
committed by GitHub
parent 2be261b78b
commit e5ad232c90
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ use crate::sql::CommandGetDbSchemas;
/// Builds rows like this:
///
/// * catalog_name: utf8,
/// * db_schema_name: utf8,
/// * db_schema_name: utf8 not null
pub struct GetDbSchemasBuilder {
// Specifies the Catalog to search for the tables.
// - An empty string retrieves those without a catalog.
@@ -177,7 +177,7 @@ fn get_db_schemas_schema() -> SchemaRef {
/// The schema for GetDbSchemas
static GET_DB_SCHEMAS_SCHEMA: Lazy<SchemaRef> = Lazy::new(|| {
Arc::new(Schema::new(vec![
Field::new("catalog_name", DataType::Utf8, false),
Field::new("catalog_name", DataType::Utf8, true),
Field::new("db_schema_name", DataType::Utf8, false),
]))
});
+4 -4
View File
@@ -291,8 +291,8 @@ fn get_tables_schema(include_schema: bool) -> SchemaRef {
/// The schema for GetTables without `table_schema` column
static GET_TABLES_SCHEMA_WITHOUT_TABLE_SCHEMA: Lazy<SchemaRef> = Lazy::new(|| {
Arc::new(Schema::new(vec![
Field::new("catalog_name", DataType::Utf8, false),
Field::new("db_schema_name", DataType::Utf8, false),
Field::new("catalog_name", DataType::Utf8, true),
Field::new("db_schema_name", DataType::Utf8, true),
Field::new("table_name", DataType::Utf8, false),
Field::new("table_type", DataType::Utf8, false),
]))
@@ -301,8 +301,8 @@ static GET_TABLES_SCHEMA_WITHOUT_TABLE_SCHEMA: Lazy<SchemaRef> = Lazy::new(|| {
/// The schema for GetTables with `table_schema` column
static GET_TABLES_SCHEMA_WITH_TABLE_SCHEMA: Lazy<SchemaRef> = Lazy::new(|| {
Arc::new(Schema::new(vec![
Field::new("catalog_name", DataType::Utf8, false),
Field::new("db_schema_name", DataType::Utf8, false),
Field::new("catalog_name", DataType::Utf8, true),
Field::new("db_schema_name", DataType::Utf8, true),
Field::new("table_name", DataType::Utf8, false),
Field::new("table_type", DataType::Utf8, false),
Field::new("table_schema", DataType::Binary, false),