Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C

data processing pipelines — concept C23

A C data pipeline is an explicit sequence of read, validation, transformation, aggregation, and write stages, usually passing buffers and error codes between functions. Every stage should state memory ownership, accepted sizes, and partial-result handling so a failure cannot leave inconsistent state.

Version: C23

Syntax

data processing pipelines

A C data pipeline is an explicit sequence of read, validation, transformation, aggregation, and write stages, usually passing buffers and error codes between functions. Every stage should state memory ownership, accepted sizes, and partial-result handling so a failure cannot leave inconsistent state.

For a file import, separate the decoder, record validator, and storage writer. Each stage should return a status plus the number of consumed or produced items so the driver can handle a short read, resume work, and reject one record without losing the batch.

Test an empty stream, a record split across two buffers, the maximum size, and a failure halfway through writing. Do not publish partial state before validation; release multiple resources in reverse acquisition order and state whether a stage may modify its input buffer.

Examples

#include <stdio.h>

int main(void) {
    int input[] = {1, 2, 3, 4};
    int total = 0;
    for (size_t i = 0; i < 4; ++i) if (input[i] % 2 == 0) total += input[i] * input[i];
    printf("%d\n", total);
    return 0;
}

Result

20

A C data pipeline is an explicit sequence of read, validation, transformation, aggregation, and write stages, usually passing buffers and error codes between functions. Every stage should state memory ownership, accepted sizes, and partial-result handling so a failure cannot leave inconsistent state.

Sources