This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new e5ad232c90 Update FlightSQL `GetDbSchemas` and `GetTables` schemas to 
fully match the protocol (#7638)
e5ad232c90 is described below

commit e5ad232c905bfa7d68c3f74d53f392d97f405b39
Author: Sergei Grebnov <[email protected]>
AuthorDate: Wed Jun 11 08:40:23 2025 -0700

    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.
---
 arrow-flight/src/sql/metadata/db_schemas.rs | 4 ++--
 arrow-flight/src/sql/metadata/tables.rs     | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arrow-flight/src/sql/metadata/db_schemas.rs 
b/arrow-flight/src/sql/metadata/db_schemas.rs
index 303d11cd74..68e8b49733 100644
--- a/arrow-flight/src/sql/metadata/db_schemas.rs
+++ b/arrow-flight/src/sql/metadata/db_schemas.rs
@@ -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),
     ]))
 });
diff --git a/arrow-flight/src/sql/metadata/tables.rs 
b/arrow-flight/src/sql/metadata/tables.rs
index 7ffb76fa1d..2cd16fdc23 100644
--- a/arrow-flight/src/sql/metadata/tables.rs
+++ b/arrow-flight/src/sql/metadata/tables.rs
@@ -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),

Reply via email to