Apache DataFusion SQL Query Engine
Improve deprecation message for MemoryExec (#14322)
Andrew Lamb8d542ecc13dd
diff --git a/datafusion/physical-plan/src/values.rs b/datafusion/physical-plan/src/values.rsindex a30b8981fd..b000f9335a 100644--- a/datafusion/physical-plan/src/values.rs+++ b/datafusion/physical-plan/src/values.rs@@ -34,7 +34,16 @@ use datafusion_execution::TaskContext;use datafusion_physical_expr::EquivalenceProperties;/// Execution plan for values list based relation (produces constant rows)-#[deprecated(since = "45.0.0", note = "Use `MemoryExec::try_new_as_values` instead")]+///+/// Note this structure is the same as [`MemoryExec`] and is deprecated.+/// Please see the following for alternatives+/// * [`MemoryExec::try_new`]+/// * [`MemoryExec::try_new_from_batches`]+///+/// [`MemoryExec`]: crate::memory::MemoryExec+/// [`MemoryExec::try_new`]: crate::memory::MemoryExec::try_new+/// [`MemoryExec::try_new_from_batches`]: crate::memory::MemoryExec::try_new_from_batches+#[deprecated(since = "45.0.0", note = "Use `MemoryExec` instead")]#[derive(Debug, Clone)]pub struct ValuesExec {/// The schema@@ -48,6 +57,7 @@ pub struct ValuesExec {#[allow(deprecated)]impl ValuesExec {/// Create a new values exec from data as expr+ #[deprecated(since = "45.0.0", note = "Use `MemoryExec::try_new` instead")]pub fn try_new(schema: SchemaRef,data: Vec<Vec<Arc<dyn PhysicalExpr>>>,@@ -101,6 +111,10 @@ impl ValuesExec {////// Errors if any of the batches don't match the provided schema, or if no/// batches are provided.+ #[deprecated(+ since = "45.0.0",+ note = "Use `MemoryExec::try_new_from_batches` instead"+ )]pub fn try_new_from_batches(schema: SchemaRef,batches: Vec<RecordBatch>,