use std::sync::Arc;
use crate::input::proto::substrait;
use crate::output::diagnostic;
use crate::output::type_system::data;
use crate::parse::context;
pub fn parse_cross_rel(
x: &substrait::CrossRel,
y: &mut context::Context,
) -> diagnostic::Result<()> {
let left = handle_rel_input!(x, y, left);
let right = handle_rel_input!(x, y, right);
if let (Some(mut fields), Some(additional_fields)) =
(left.unwrap_struct(), right.unwrap_struct())
{
fields.extend(additional_fields);
let schema = data::new_struct(fields, false);
y.set_schema(schema);
} else {
y.set_schema(Arc::default());
}
describe!(y, Relation, "Cross product");
summary!(
y,
"This relation computes the cross product of its two input datasets."
);
handle_rel_common!(x, y);
handle_advanced_extension!(x, y);
Ok(())
}