You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2023/01/18 18:26:18 UTC

[arrow-datafusion] branch master updated: Add DataFusionError::Substrait variant to DataFusionError enum (#4971)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 896fd3f8f Add DataFusionError::Substrait variant to DataFusionError enum (#4971)
896fd3f8f is described below

commit 896fd3f8f0fec61a699b7f883f5508dc5658fc96
Author: Jeremy Dyer <jd...@gmail.com>
AuthorDate: Wed Jan 18 13:26:11 2023 -0500

    Add DataFusionError::Substrait variant to DataFusionError enum (#4971)
---
 datafusion/common/src/error.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/datafusion/common/src/error.rs b/datafusion/common/src/error.rs
index a405da353..9b8d19cf8 100644
--- a/datafusion/common/src/error.rs
+++ b/datafusion/common/src/error.rs
@@ -86,6 +86,9 @@ pub enum DataFusionError {
     JITError(ModuleError),
     /// Error with additional context
     Context(String, Box<DataFusionError>),
+    /// Errors originating from either mapping LogicalPlans to/from Substrait plans
+    /// or serializing/deserializing protobytes to Substrait plans
+    Substrait(String),
 }
 
 #[macro_export]
@@ -318,6 +321,9 @@ impl Display for DataFusionError {
             DataFusionError::Context(ref desc, ref err) => {
                 write!(f, "{}\ncaused by\n{}", desc, *err)
             }
+            DataFusionError::Substrait(ref desc) => {
+                write!(f, "Substrait error: {desc}")
+            }
         }
     }
 }