## Coverage Report

#### Created: 2024-10-13 08:39

    /Users/andrewlamb/Software/datafusion/datafusion/physical-plan/src/windows/utils.rs

    Line
    Count
    Source (jump to first uncovered line)
    1
    // Licensed to the Apache Software Foundation (ASF) under one
    2
    // or more contributor license agreements.  See the NOTICE file
    3
    // distributed with this work for additional information
    4
    // regarding copyright ownership.  The ASF licenses this file
    5
    // to you under the Apache License, Version 2.0 (the
    6
    // "License"); you may not use this file except in compliance
    7
    // with the License.  You may obtain a copy of the License at
    8
    //
    9
    //   http://www.apache.org/licenses/LICENSE-2.0
    10
    //
    11
    // Unless required by applicable law or agreed to in writing,
    12
    // software distributed under the License is distributed on an
    13
    // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    14
    // KIND, either express or implied.  See the License for the
    15
    // specific language governing permissions and limitations
    16
    // under the License.
    17
    18
    use arrow_schema::{Schema, SchemaBuilder};
    19
    use datafusion_common::Result;
    20
    use datafusion_physical_expr::window::WindowExpr;
    21
    use std::sync::Arc;
    22
    23
    3
    pub(crate) fn create_schema(
    24
    3
        input_schema: &Schema,
    25
    3
        window_expr: &[Arc<dyn WindowExpr>],
    26
    3
    ) -> Result<Schema> {
    27
    3
        let capacity = input_schema.fields().len() + window_expr.len();
    28
    3
        let mut builder = SchemaBuilder::with_capacity(capacity);
    29
    3
        builder.extend(input_schema.fields().iter().cloned());
    30
        // append results to the schema
    31
    8
        for expr5 in window_expr {
    32
    5
            builder.push(expr.field()?0);
    33
        }
    34
    3
        Ok(builder.finish())
    35
    3
    }