Skip to content

Commit

Permalink
Fix flat data assertion in CSV writer
Browse files Browse the repository at this point in the history
  • Loading branch information
arnodb committed Feb 10, 2025
1 parent 50f11a6 commit f465468
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions contrib/quirky_binder_csv/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@ pub struct WriteCsv {

impl WriteCsv {
fn new<R: TypeResolver + Copy>(
_graph: &mut GraphBuilder<R>,
graph: &mut GraphBuilder<R>,
name: FullyQualifiedName,
inputs: [NodeStream; 1],
params: WriteCsvParams,
) -> ChainResultWithTrace<Self> {
if !inputs.single().sub_streams().is_empty() {
return Err(ChainError::Other {
msg: "Sub streams are not supported".to_owned(),
})
.with_trace_element(trace_element!(WRITE_CSV_TRACE_NAME));
let input = inputs.single();
let input_stream_def = graph
.get_stream(input.record_type())
.with_trace_element(trace_element!(WRITE_CSV_TRACE_NAME))?
.borrow();
for d in input_stream_def.get_current_data() {
if input.sub_streams().contains_key(&d) {
return Err(ChainError::Other {
msg: "Sub streams are not supported".to_owned(),
})
.with_trace_element(trace_element!(WRITE_CSV_TRACE_NAME));
}
}

Ok(Self {
Expand Down

0 comments on commit f465468

Please sign in to comment.