% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/def.wrte.parq.R
\name{def.wrte.parq}
\alias{def.wrte.parq}
\title{Write Parquet file}
\usage{
def.wrte.parq(
  data,
  NameFile,
  Schm = NULL,
  NameFileSchm = NULL,
  CompType = "zstd",
  CompLvl = 5,
  Dict = NULL,
  log = NULL
)
}
\arguments{
\item{data}{Data frame. Data to write to file. This can also be an object of class arrow_dplyr_query,
but there is currently only support for auto-creating the schema from the object.}

\item{NameFile}{String. Name (including relative or absolute path) of output parquet file.}

\item{Schm}{Optional. Either a Parquet schema of class ArrowObject, or a Json formatted string 
with an AVRO file schema. Example:\cr
"{\"type\" : \"record\",\"name\" : \"ST\",\"namespace\" : \"org.neonscience.schema.device\",\"fields\" : [ {\"name\" :\"readout_time\",\"type\" : {\"type\" : \"long\",\"logicalType\" : \"timestamp-millis\"},\"doc\" : \"Timestamp of readout expressed in milliseconds since epoch\"}, {\"name\" : \"soilPRTResistance\",\"type\" : [ \"null\", \"float\" ],\"doc\" : \"DPID: DP0.00041.001 TermID: 1728 Units: ohm Description: Soil Temperature, Level 0\",\"default\" : null} ],\"__fastavro_parsed\" : true}"\cr
Defaults to NULL, in which case the schema will be constructed using the argument NameFileSchm 
(if not NULL) or auto-generated from the data frame.}

\item{NameFileSchm}{String. Optional. A filename (include relative or aboslute path) of an avro 
schema file (.avsc format). Defaults to NULL, in which case the schema will be constructed using 
the Schm argument (if not NULL) or auto-generated from the input data.}

\item{CompType}{String. Compression algorithm. Defaults to 'gzip'. Can also be NULL, in which case
the arrow::write_parquet default will be used.}

\item{CompLvl}{Numeric. Compression level. See documentation for arrow::write_parquet for details.}

\item{Dict}{Logical. Vector either length 1 or the same length as the number of columns in \code{data} 
representing  whether to apply dictionary encoding to each respective data column. If length 1, the 
choice is applied to all data columns. Defaults to NULL, in which case dictionary encoding is 
determined automatically based on the prevalence of repeated values.}

\item{log}{A logger object as produced by NEONprocIS.base::def.log.init to produce structured log
output. Defaults to NULL, in which the logger will be created and used within the function.}
}
\value{
The data frame as written to the output.
}
\description{
Definition function. Write Parquet file from data frame. Optionally input a parquet or
avro schema to convert column names and/or data types. Any variables of class factor will
be written as class character.
}
\examples{
data <- data.frame(x=c(1,2,3),y=c('one','two','three'),stringsAsFactors=FALSE)
dataOut <- NEONprocIS.base::def.wrte.parq(data,NameFile='out.parquet')
}
\references{
License: (example) GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
}
\seealso{
\link[NEONprocIS.base]{def.read.parq}

\link[arrow]{write_parquet}
}
\author{
Cove Sturtevant \email{csturtevant@battelleecology.org}
}
\keyword{Currently}
\keyword{none}
