jayshrivastava commented on code in PR #22464:
URL: https://github.com/apache/datafusion/pull/22464#discussion_r3298633209
##########
datafusion/physical-expr/src/expressions/unknown_column.rs:
##########
@@ -99,3 +139,83 @@ impl PartialEq for UnKnownColumn {
false
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[cfg(feature = "proto")]
+ use std::sync::Arc;
+
+ #[cfg(feature = "proto")]
+ use arrow::datatypes::Schema;
+
+ #[cfg(feature = "proto")]
+ use datafusion_common::{Result, internal_err};
+
+ #[cfg(feature = "proto")]
+ use
datafusion_physical_expr_common::physical_expr::proto_decode::PhysicalExprDecodeCtx;
+
+ #[cfg(feature = "proto")]
+ struct DummyDecode;
+
+ #[cfg(feature = "proto")]
+ impl
datafusion_physical_expr_common::physical_expr::proto_decode::PhysicalExprDecode
+ for DummyDecode
+ {
+ fn decode(
+ &self,
+ _node: &datafusion_proto_models::protobuf::PhysicalExprNode,
+ _schema: &Schema,
+ ) -> Result<Arc<dyn PhysicalExpr>> {
+ internal_err!("decode should not be called")
+ }
+ }
+
+ #[cfg(feature = "proto")]
+ #[test]
+ fn try_from_proto_reports_found_variant() {
+ use datafusion_proto_models::protobuf;
+
+ let node = protobuf::PhysicalExprNode {
+ expr_id: Some(7),
+ expr_type: Some(protobuf::physical_expr_node::ExprType::Column(
+ protobuf::PhysicalColumn {
+ name: "col_a".to_string(),
+ index: 0,
+ },
+ )),
+ };
+ let schema = Schema::empty();
+ let decoder = DummyDecode;
Review Comment:
The `UnreachableDecoder` is a good utility to use here.
https://github.com/apache/datafusion/blob/4a41173ba3df9b5d47638599c819a1e6e46ad92b/datafusion/physical-expr/src/expressions/like.rs?plain=1#L465
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]