% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/table_stream.R
\name{stream_sum}
\alias{stream_sum}
\title{Stream sum of a numeric column}
\usage{
stream_sum(x, col, na_rm = TRUE)
}
\arguments{
\item{x}{A \code{shard_row_groups} or \code{shard_dataset} handle.}

\item{col}{Column name to sum.}

\item{na_rm}{Logical; drop NAs (default TRUE).}
}
\value{
A single numeric value giving the sum of the column across all partitions.
}
\description{
Computes the sum of \code{col} across all partitions without collecting the full
dataset. When partitions are native-encoded, this avoids decoding string
columns entirely.
}
\examples{
\donttest{
s <- schema(x = float64())
sink <- table_sink(s, mode = "row_groups")
table_write(sink, 1L, data.frame(x = c(1.0, 2.0, 3.0)))
rg <- table_finalize(sink)
stream_sum(rg, "x")
}
}
