diff --git a/flightsql/src/planner.rs b/flightsql/src/planner.rs index 2c4498dd1d..f917795c38 100644 --- a/flightsql/src/planner.rs +++ b/flightsql/src/planner.rs @@ -19,7 +19,7 @@ use arrow_flight::{ }; use arrow_util::flight::prepare_schema_for_flight; use bytes::Bytes; -use datafusion::{logical_expr::LogicalPlan, physical_plan::ExecutionPlan}; +use datafusion::{error::DataFusionError, logical_expr::LogicalPlan, physical_plan::ExecutionPlan}; use iox_query::{exec::IOxSessionContext, QueryNamespace}; use observability_deps::tracing::debug; use once_cell::sync::Lazy; @@ -434,7 +434,9 @@ async fn plan_get_xdbc_type_info( match data_type { None => Ok(ctx.batch_to_logical_plan(TYPE_INFO_RECORD_BATCH.clone())?), // TODO chunchun: support search by data_type - Some(_data_type) => unimplemented!("filter by data_type is not implemented yet"), + Some(_data_type) => Err(Error::from(DataFusionError::NotImplemented( + "GetXdbcTypeInfo does not yet support filtering by data_type".to_string(), + ))), } } diff --git a/influxdb_iox/tests/end_to_end_cases/flightsql.rs b/influxdb_iox/tests/end_to_end_cases/flightsql.rs index 5274f4ff28..1cecbe32f4 100644 --- a/influxdb_iox/tests/end_to_end_cases/flightsql.rs +++ b/influxdb_iox/tests/end_to_end_cases/flightsql.rs @@ -1149,7 +1149,6 @@ async fn flightsql_get_xdbc_type_info() { Step::Custom(Box::new(move |state: &mut StepTestState| { async move { let mut client = flightsql_client(state.cluster()); - // TODO chunchun: search by data_type test case let data_type: Option = None; let stream = client.get_xdbc_type_info(data_type).await.unwrap(); @@ -1173,6 +1172,20 @@ async fn flightsql_get_xdbc_type_info() { } .boxed() })), + Step::Custom(Box::new(move |state: &mut StepTestState| { + async move { + let mut client = flightsql_client(state.cluster()); + // TODO chunchun: search by data_type test case + let data_type: Option = Some(6); + + let err = client.get_xdbc_type_info(data_type).await.unwrap_err(); + + assert_matches!(err, FlightError::Tonic(..)); + assert_contains!(err.to_string(), "GetXdbcTypeInfo does not yet support filtering by data_type"); + + } + .boxed() + })), ], ) .run()