alamb commented on code in PR #4293:
URL: https://github.com/apache/arrow-rs/pull/4293#discussion_r1207861857
##########
arrow-flight/src/sql/mod.rs:
##########
@@ -27,6 +27,7 @@
//! 2. Helpers for encoding and decoding FlightSQL messages: [`Any`] and
[`Command`]
//! 3. A [`FlightSqlServiceClient`] for interacting with FlightSQL servers.
//! 4. A [`FlightSqlService`] to help building FlightSQL servers from
[`FlightService`].
+//! 5. Structures to build responses for FlightSQL metadata APIs:
[`SqlInfoList`]
Review Comment:
Hopefully this will help finding the structure
##########
arrow-flight/src/sql/sql_info.rs:
##########
@@ -345,7 +370,53 @@ static SQL_INFO_SCHEMA: Lazy<Schema> = Lazy::new(|| {
#[cfg(test)]
mod tests {
use super::SqlInfoList;
- use crate::sql::{SqlInfo, SqlSupportedTransaction};
+ use crate::sql::{SqlInfo, SqlNullOrdering, SqlSupportedTransaction};
+ use arrow_array::RecordBatch;
+ use arrow_cast::pretty::pretty_format_batches;
+
+ fn assert_batches_eq(batches: &[RecordBatch], expected_lines: &[&str]) {
+ let formatted = pretty_format_batches(batches).unwrap().to_string();
+ let actual_lines: Vec<_> = formatted.trim().lines().collect();
+ assert_eq!(
+ &actual_lines, expected_lines,
+ "\n\nexpected:\n\n{:#?}\nactual:\n\n{:#?}\n\n",
+ expected_lines, actual_lines
+ );
+ }
+
+ #[test]
+ fn test_sql_infos() {
Review Comment:
I thought this would be a useful test too
##########
arrow-flight/src/sql/sql_info.rs:
##########
@@ -15,16 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-//! Auxiliary module to handle [`crate::sql::CommandGetSqlInfo`] queries.
+//! [`SqlInfoList`] for building responses to [`CommandGetSqlInfo`] queries.
//!
-//! [`crate::sql::CommandGetSqlInfo`] represents metadata requests againsts
the Flight SQL server.
Review Comment:
I moved this content to the struct itself as I think that is easier to find
##########
arrow-flight/src/sql/sql_info.rs:
##########
@@ -260,7 +253,37 @@ impl SqlInfoUnionBuilder {
}
}
-/// A list of SQL info names and valies
+/// A list of FlightSQL server capabilties.
+///
+/// [`CommandGetSqlInfo`] are metadata requests used by a Flight SQL
+/// server to communicate supported capabilities to Flight SQL
+/// clients.
+///
+/// Servers construct a [`SqlInfoList`] by adding infos via
+/// [`with_sql_info`] and build the response using [`encode`].
+///
+/// The availabe configuration options are defined in the [Flight SQL
protos][protos].
+///
+/// # Example
+/// ```
+/// # use arrow_flight::sql::{SqlInfoList, SqlInfo, SqlSupportedTransaction};
Review Comment:
added doc example
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]