// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package parquet

import (
	
	
	
	format 
)

// Constants for default property values used for the default reader, writer and column props.
const (
	// Default Buffer size used for the Reader
	DefaultBufSize int64 = 4096 * 4
	// Default data page size limit is 1K it's not guaranteed, but we will try to
	// cut data pages off at this size where possible.
	DefaultDataPageSize int64 = 1024 * 1024
	// Default is for dictionary encoding to be turned on, use WithDictionaryDefault
	// writer property to change that.
	DefaultDictionaryEnabled = true
	// If the dictionary reaches the size of this limitation, the writer will use
	// the fallback encoding (usually plain) instead of continuing to build the
	// dictionary index.
	DefaultDictionaryPageSizeLimit = DefaultDataPageSize
	// In order to attempt to facilitate data page size limits for writing,
	// data is written in batches. Increasing the batch size may improve performance
	// but the larger the batch size, the easier it is to overshoot the datapage limit.
	DefaultWriteBatchSize int64 = 1024
	// Default maximum number of rows for a single row group
	DefaultMaxRowGroupLen int64 = 64 * 1024 * 1024
	// Default is to have stats enabled for all columns, use writer properties to
	// change the default, or to enable/disable for specific columns.
	DefaultStatsEnabled = true
	// If the stats are larger than 4K the writer will skip writing them out anyways.
	DefaultMaxStatsSize int64 = 4096
	// Default is to not write page indexes for columns
	DefaultPageIndexEnabled = false
	DefaultCreatedBy        = "parquet-go version " + arrow.PkgVersion
	DefaultRootName         = "schema"

	DefaultMaxBloomFilterBytes        = 1024 * 1024
	DefaultBloomFilterEnabled         = false
	DefaultBloomFilterFPP             = 0.01
	DefaultAdaptiveBloomFilterEnabled = false
	DefaultBloomFilterCandidates      = 5
)

// ColumnProperties defines the encoding, codec, and so on for a given column.
type ColumnProperties struct {
	Encoding                   Encoding
	Codec                      compress.Compression
	DictionaryEnabled          bool
	StatsEnabled               bool
	PageIndexEnabled           bool
	MaxStatsSize               int64
	CompressionLevel           int
	BloomFilterEnabled         bool
	BloomFilterFPP             float64
	AdaptiveBloomFilterEnabled bool
	BloomFilterCandidates      int
	BloomFilterNDV             int64
}

// DefaultColumnProperties returns the default properties which get utilized for writing.
//
// The default column properties are the following constants:
//
// Encoding:                   Encodings.Plain
// Codec:                      compress.Codecs.Uncompressed
// DictionaryEnabled:	       DefaultDictionaryEnabled
// StatsEnabled:               DefaultStatsEnabled
// PageIndexEnabled:           DefaultPageIndexEnabled
// MaxStatsSize:               DefaultMaxStatsSize
// CompressionLevel:           compress.DefaultCompressionLevel
// BloomFilterEnabled:         DefaultBloomFilterEnabled
// BloomFilterFPP:             DefaultBloomFilterFPP
// AdaptiveBloomFilterEnabled: DefaultAdaptiveBloomFilterEnabled
// BloomFilterCandidates:      DefaultBloomFilterCandidates
func () ColumnProperties {
	return ColumnProperties{
		Encoding:                   Encodings.Plain,
		Codec:                      compress.Codecs.Uncompressed,
		DictionaryEnabled:          DefaultDictionaryEnabled,
		StatsEnabled:               DefaultStatsEnabled,
		PageIndexEnabled:           DefaultPageIndexEnabled,
		MaxStatsSize:               DefaultMaxStatsSize,
		CompressionLevel:           compress.DefaultCompressionLevel,
		BloomFilterEnabled:         DefaultBloomFilterEnabled,
		BloomFilterFPP:             DefaultBloomFilterFPP,
		AdaptiveBloomFilterEnabled: DefaultAdaptiveBloomFilterEnabled,
		BloomFilterCandidates:      DefaultBloomFilterCandidates,
	}
}

// SortingColumn specifies a sort order within a rowgroup of a specific leaf column.
type SortingColumn = format.SortingColumn

type writerPropConfig struct {
	wr                         *WriterProperties
	encodings                  map[string]Encoding
	codecs                     map[string]compress.Compression
	compressLevel              map[string]int
	dictEnabled                map[string]bool
	statsEnabled               map[string]bool
	indexEnabled               map[string]bool
	bloomFilterNDVs            map[string]int64
	bloomFilterFPPs            map[string]float64
	bloomFilterEnabled         map[string]bool
	adaptiveBloomFilterEnabled map[string]bool
	numBloomFilterCandidates   map[string]int
}

// WriterProperty is used as the options for building a writer properties instance
type WriterProperty func(*writerPropConfig)

// WithAllocator specifies the writer to use the given allocator
func ( memory.Allocator) WriterProperty {
	return func( *writerPropConfig) {
		.wr.mem = 
	}
}

// WithDictionaryDefault sets the default value for whether to enable dictionary encoding
func ( bool) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.DictionaryEnabled = 
	}
}

// WithDictionaryFor allows enabling or disabling dictionary encoding for a given column path string
func ( string,  bool) WriterProperty {
	return func( *writerPropConfig) {
		.dictEnabled[] = 
	}
}

// WithDictionaryPath is like WithDictionaryFor, but takes a ColumnPath type
func ( ColumnPath,  bool) WriterProperty {
	return WithDictionaryFor(.String(), )
}

// WithDictionaryPageSizeLimit is the limit of the dictionary at which the writer
// will fallback to plain encoding instead
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.dictPagesize = 
	}
}

// WithBatchSize specifies the number of rows to use for batch writes to columns
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.batchSize = 
	}
}

// WithMaxRowGroupLength specifies the number of rows as the maximum number of rows for a given row group in the writer.
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.maxRowGroupLen = 
	}
}

// WithDataPageSize specifies the size to use for splitting data pages for column writing.
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.pageSize = 
	}
}

// WithDataPageVersion specifies whether to use Version 1 or Version 2 of the DataPage spec
func ( DataPageVersion) WriterProperty {
	return func( *writerPropConfig) {
		.wr.dataPageVersion = 
	}
}

// WithVersion specifies which Parquet Spec version to utilize for writing.
func ( Version) WriterProperty {
	return func( *writerPropConfig) {
		.wr.parquetVersion = 
	}
}

// WithCreatedBy specifies the "created by" string to use for the writer
func ( string) WriterProperty {
	return func( *writerPropConfig) {
		.wr.createdBy = 
	}
}

// WithRootName enables customization of the name used for the root schema node. This is required
// to maintain compatibility with other tools.
func ( string) WriterProperty {
	return func( *writerPropConfig) {
		.wr.rootName = 
	}
}

// WithRootRepetition enables customization of the repetition used for the root schema node.
// This is required to maintain compatibility with other tools.
func ( Repetition) WriterProperty {
	return func( *writerPropConfig) {
		.wr.rootRepetition = 
	}
}

// WithEncoding defines the encoding that is used when we aren't using dictionary encoding.
//
// This is either applied if dictionary encoding is disabled, or if we fallback if the dictionary
// grew too large.
func ( Encoding) WriterProperty {
	return func( *writerPropConfig) {
		if  == Encodings.PlainDict ||  == Encodings.RLEDict {
			panic("parquet: can't use dictionary encoding as fallback encoding")
		}
		.wr.defColumnProps.Encoding = 
	}
}

// WithEncodingFor is for defining the encoding only for a specific column path. This encoding will be used
// if dictionary encoding is disabled for the column or if we fallback because the dictionary grew too large
func ( string,  Encoding) WriterProperty {
	return func( *writerPropConfig) {
		if  == Encodings.PlainDict ||  == Encodings.RLEDict {
			panic("parquet: can't use dictionary encoding as fallback encoding")
		}
		.encodings[] = 
	}
}

// WithEncodingPath is the same as WithEncodingFor but takes a ColumnPath directly.
func ( ColumnPath,  Encoding) WriterProperty {
	return WithEncodingFor(.String(), )
}

// WithCompression specifies the default compression type to use for column writing.
func ( compress.Compression) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.Codec = 
	}
}

// WithCompressionFor specifies the compression type for the given column.
func ( string,  compress.Compression) WriterProperty {
	return func( *writerPropConfig) {
		.codecs[] = 
	}
}

// WithCompressionPath is the same as WithCompressionFor but takes a ColumnPath directly.
func ( ColumnPath,  compress.Compression) WriterProperty {
	return WithCompressionFor(.String(), )
}

// WithMaxStatsSize sets a maximum size for the statistics before we decide not to include them.
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.MaxStatsSize = 
	}
}

// WithCompressionLevel specifies the default compression level for the compressor in every column.
//
// The provided compression level is compressor specific. The user would have to know what the available
// levels are for the selected compressor. If the compressor does not allow for selecting different
// compression levels, then this function will have no effect. Parquet and Arrow will not validate the
// passed compression level. If no level is selected by the user or if the special compress.DefaultCompressionLevel
// value is used, then parquet will select the compression level.
func ( int) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.CompressionLevel = 
	}
}

// WithCompressionLevelFor is like WithCompressionLevel but only for the given column path.
func ( string,  int) WriterProperty {
	return func( *writerPropConfig) {
		.compressLevel[] = 
	}
}

// WithCompressionLevelPath is the same as WithCompressionLevelFor but takes a ColumnPath
func ( ColumnPath,  int) WriterProperty {
	return WithCompressionLevelFor(.String(), )
}

// WithStats specifies a default for whether or not to enable column statistics.
func ( bool) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.StatsEnabled = 
	}
}

// WithStatsFor specifies a per column value as to enable or disable statistics in the resulting file.
func ( string,  bool) WriterProperty {
	return func( *writerPropConfig) {
		.statsEnabled[] = 
	}
}

// WithStatsPath is the same as WithStatsFor but takes a ColumnPath
func ( ColumnPath,  bool) WriterProperty {
	return WithStatsFor(.String(), )
}

// WithEncryptionProperties specifies the file level encryption handling for writing the file.
func ( *FileEncryptionProperties) WriterProperty {
	return func( *writerPropConfig) {
		.wr.encryptionProps = 
	}
}

// WithStoreDecimalAsInteger specifies whether to try using an int32/int64 for storing
// decimal data rather than fixed len byte arrays if the precision is low enough.
func ( bool) WriterProperty {
	return func( *writerPropConfig) {
		.wr.storeDecimalAsInt = 
	}
}

// WithSortingColumns allow specifying the sorting columns in the written metadata.
// If this is set, the user should ensure that records are sorted by these columns,
// otherwise the sorting data will be inconsistent with the sorting_columns metadata.
func ( []SortingColumn) WriterProperty {
	return func( *writerPropConfig) {
		.wr.sortingCols = 
	}
}

// WithPageIndexEnabled specifies the default value for whether or not to write page indexes for columns
func ( bool) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.PageIndexEnabled = 
	}
}

// WithPageIndexEnabled specifies a per column value as to enable or disable writing page indexes for the column
func ( string,  bool) WriterProperty {
	return func( *writerPropConfig) {
		.indexEnabled[] = 
	}
}

// WithPageIndexEnabledPath is like WithPageIndexEnabledFor, but takes a ColumnPath
func ( ColumnPath,  bool) WriterProperty {
	return WithPageIndexEnabledFor(.String(), )
}

// WithMaxBloomFilterBytes sets the maximum size for a bloom filter, after which
// it is abandoned and not written to the file.
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.maxBloomFilterBytes = 
	}
}

// WithBloomFilterEnabled sets the default value for whether to enable writing bloom
// filters for columns. This is the default value for all columns, but can be overridden
// by using WithBloomFilterEnabledFor or WithBloomFilterEnabledPath.
func ( bool) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.BloomFilterEnabled = 
	}
}

// WithBloomFilterEnabledFor specifies a per column value as to enable or disable writing
// bloom filters for the column.
func ( string,  bool) WriterProperty {
	return func( *writerPropConfig) {
		.bloomFilterEnabled[] = 
	}
}

// WithBloomFilterEnabledPath is like WithBloomFilterEnabledFor, but takes a ColumnPath
func ( ColumnPath,  bool) WriterProperty {
	return WithBloomFilterEnabledFor(.String(), )
}

// WithBloomFilterFPP sets the default value for the false positive probability for writing
// bloom filters.
func ( float64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.BloomFilterFPP = 
	}
}

// WithBloomFilterFPPFor specifies a per column value for the false positive probability
// for writing bloom filters.
func ( string,  float64) WriterProperty {
	return func( *writerPropConfig) {
		.bloomFilterFPPs[] = 
	}
}

// WithBloomFilterFPPPath is like WithBloomFilterFPPFor, but takes a ColumnPath
func ( ColumnPath,  float64) WriterProperty {
	return WithBloomFilterFPPFor(.String(), )
}

// WithAdaptiveBloomFilterEnabled sets the default value for whether to enable writing
// adaptive bloom filters for columns. This is the default value for all columns,
// but can be overridden by using WithAdaptiveBloomFilterEnabledFor or
// WithAdaptiveBloomFilterEnabledPath.
//
// Using an Adaptive Bloom filter will attempt to use multiple candidate bloom filters
// when building the column, with different expected distinct values. It will attempt
// to use the smallest candidate bloom filter that achieves the desired false positive
// probability. Dropping candidates bloom filters that are no longer viable.
func ( bool) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.AdaptiveBloomFilterEnabled = 
	}
}

// WithAdaptiveBloomFilterEnabledFor specifies a per column value as to enable or disable writing
// adaptive bloom filters for the column.
func ( string,  bool) WriterProperty {
	return func( *writerPropConfig) {
		.adaptiveBloomFilterEnabled[] = 
	}
}

// WithAdaptiveBloomFilterEnabledPath is like WithAdaptiveBloomFilterEnabledFor, but takes a ColumnPath
func ( ColumnPath,  bool) WriterProperty {
	return WithAdaptiveBloomFilterEnabledFor(.String(), )
}

// WithBloomFilterCandidates sets the number of candidate bloom filters to use when building
// an adaptive bloom filter.
func ( int) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.BloomFilterCandidates = 
	}
}

// WithBloomFilterCandidatesFor specifies a per column value for the number of candidate
// bloom filters to use when building an adaptive bloom filter.
func ( string,  int) WriterProperty {
	return func( *writerPropConfig) {
		.numBloomFilterCandidates[] = 
	}
}

// WithBloomFilterCandidatesPath is like WithBloomFilterCandidatesFor, but takes a ColumnPath
func ( ColumnPath,  int) WriterProperty {
	return WithBloomFilterCandidatesFor(.String(), )
}

// WithBloomFilterNDV sets the default value for the expected number of distinct values
// to be written for the column. This is ignored when using adaptive bloom filters.
func ( int64) WriterProperty {
	return func( *writerPropConfig) {
		.wr.defColumnProps.BloomFilterNDV = 
	}
}

// WithBloomFilterNDVFor specifies a per column value for the expected number of distinct values
// to be written for the column. This is ignored when using adaptive bloom filters.
func ( string,  int64) WriterProperty {
	return func( *writerPropConfig) {
		.bloomFilterNDVs[] = 
	}
}

// WithBloomFilterNDVPath is like WithBloomFilterNDVFor, but takes a ColumnPath
func ( ColumnPath,  int64) WriterProperty {
	return WithBloomFilterNDVFor(.String(), )
}

// WriterProperties is the collection of properties to use for writing a parquet file. The values are
// read only once it has been constructed.
type WriterProperties struct {
	mem                 memory.Allocator
	dictPagesize        int64
	batchSize           int64
	maxRowGroupLen      int64
	pageSize            int64
	parquetVersion      Version
	createdBy           string
	dataPageVersion     DataPageVersion
	rootName            string
	rootRepetition      Repetition
	storeDecimalAsInt   bool
	maxBloomFilterBytes int64

	defColumnProps  ColumnProperties
	columnProps     map[string]*ColumnProperties
	encryptionProps *FileEncryptionProperties
	sortingCols     []SortingColumn
}

func defaultWriterProperties() *WriterProperties {
	return &WriterProperties{
		mem:                 memory.DefaultAllocator,
		dictPagesize:        DefaultDictionaryPageSizeLimit,
		batchSize:           DefaultWriteBatchSize,
		maxRowGroupLen:      DefaultMaxRowGroupLen,
		pageSize:            DefaultDataPageSize,
		parquetVersion:      V2_LATEST,
		dataPageVersion:     DataPageV1,
		createdBy:           DefaultCreatedBy,
		rootName:            DefaultRootName,
		rootRepetition:      Repetitions.Repeated,
		maxBloomFilterBytes: DefaultMaxBloomFilterBytes,
		defColumnProps:      DefaultColumnProperties(),
		sortingCols:         []SortingColumn{},
	}
}

// NewWriterProperties takes a list of options for building the properties. If multiple options are used which conflict
// then the last option is the one which will take effect. If no WriterProperty options are provided, then the default
// properties will be utilized for writing.
//
// The Default properties use the following constants:
//
//	Allocator:          memory.DefaultAllocator
//	DictionaryPageSize: DefaultDictionaryPageSizeLimit
//	BatchSize:          DefaultWriteBatchSize
//	MaxRowGroupLength:  DefaultMaxRowGroupLen
//	PageSize:           DefaultDataPageSize
//	ParquetVersion:     V2_LATEST
//	DataPageVersion:    DataPageV1
//	CreatedBy:          DefaultCreatedBy
func ( ...WriterProperty) *WriterProperties {
	 := writerPropConfig{
		wr:                         defaultWriterProperties(),
		encodings:                  make(map[string]Encoding),
		codecs:                     make(map[string]compress.Compression),
		compressLevel:              make(map[string]int),
		dictEnabled:                make(map[string]bool),
		statsEnabled:               make(map[string]bool),
		indexEnabled:               make(map[string]bool),
		bloomFilterNDVs:            make(map[string]int64),
		bloomFilterFPPs:            make(map[string]float64),
		bloomFilterEnabled:         make(map[string]bool),
		adaptiveBloomFilterEnabled: make(map[string]bool),
		numBloomFilterCandidates:   make(map[string]int),
	}
	for ,  := range  {
		(&)
	}

	.wr.columnProps = make(map[string]*ColumnProperties)
	 := func( string) *ColumnProperties {
		if ,  := .wr.columnProps[];  {
			return 
		}
		.wr.columnProps[] = new(ColumnProperties)
		*.wr.columnProps[] = .wr.defColumnProps
		return .wr.columnProps[]
	}

	for ,  := range .encodings {
		().Encoding = 
	}

	for ,  := range .codecs {
		().Codec = 
	}

	for ,  := range .compressLevel {
		().CompressionLevel = 
	}

	for ,  := range .dictEnabled {
		().DictionaryEnabled = 
	}

	for ,  := range .statsEnabled {
		().StatsEnabled = 
	}

	for ,  := range .indexEnabled {
		().PageIndexEnabled = 
	}

	for ,  := range .bloomFilterEnabled {
		().BloomFilterEnabled = 
	}

	for ,  := range .bloomFilterFPPs {
		().BloomFilterFPP = 
	}

	for ,  := range .bloomFilterNDVs {
		().BloomFilterNDV = 
	}

	for ,  := range .adaptiveBloomFilterEnabled {
		().AdaptiveBloomFilterEnabled = 
	}

	for ,  := range .numBloomFilterCandidates {
		().BloomFilterCandidates = 
	}

	return .wr
}

// FileEncryptionProperties returns the current encryption properties that were
// used to create the writer properties.
func ( *WriterProperties) () *FileEncryptionProperties {
	return .encryptionProps
}

func ( *WriterProperties) () memory.Allocator      { return .mem }
func ( *WriterProperties) () string                { return .createdBy }
func ( *WriterProperties) () string                 { return .rootName }
func ( *WriterProperties) () Repetition       { return .rootRepetition }
func ( *WriterProperties) () int64            { return .batchSize }
func ( *WriterProperties) () int64              { return .pageSize }
func ( *WriterProperties) () int64   { return .dictPagesize }
func ( *WriterProperties) () Version                 { return .parquetVersion }
func ( *WriterProperties) () DataPageVersion { return .dataPageVersion }
func ( *WriterProperties) () int64         { return .maxRowGroupLen }
func ( *WriterProperties) () []SortingColumn  { return .sortingCols }

// Compression returns the default compression type that will be used for any columns that don't
// have a specific compression defined.
func ( *WriterProperties) () compress.Compression { return .defColumnProps.Codec }

// CompressionFor will return the compression type that is specified for the given column path, or
// the default compression codec if there isn't one specific to this column.
func ( *WriterProperties) ( string) compress.Compression {
	if ,  := .columnProps[];  {
		return .Codec
	}
	return .defColumnProps.Codec
}

// CompressionPath is the same as CompressionFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) compress.Compression {
	return .CompressionFor(.String())
}

// CompressionLevel returns the default compression level that will be used for any column
// that doesn't have a compression level specified for it.
func ( *WriterProperties) () int { return .defColumnProps.CompressionLevel }

// CompressionLevelFor returns the compression level that will be utilized for the given column,
// or the default compression level if the column doesn't have a specific level specified.
func ( *WriterProperties) ( string) int {
	if ,  := .columnProps[];  {
		return .CompressionLevel
	}
	return .defColumnProps.CompressionLevel
}

// CompressionLevelPath is the same as CompressionLevelFor but takes a ColumnPath object
func ( *WriterProperties) ( ColumnPath) int {
	return .CompressionLevelFor(.String())
}

// Encoding returns the default encoding that will be utilized for any columns which don't have a different value
// specified.
func ( *WriterProperties) () Encoding { return .defColumnProps.Encoding }

// EncodingFor returns the encoding that will be used for the given column path, or the default encoding if there
// isn't one specified for this column.
func ( *WriterProperties) ( string) Encoding {
	if ,  := .columnProps[];  {
		return .Encoding
	}
	return .defColumnProps.Encoding
}

// EncodingPath is the same as EncodingFor but takes a ColumnPath object
func ( *WriterProperties) ( ColumnPath) Encoding {
	return .EncodingFor(.String())
}

// DictionaryIndexEncoding returns which encoding will be used for the Dictionary Index values based on the
// parquet version. V1 uses PlainDict and V2 uses RLEDict
func ( *WriterProperties) () Encoding {
	if .parquetVersion == V1_0 {
		return Encodings.PlainDict
	}
	return Encodings.RLEDict
}

// DictionaryPageEncoding returns the encoding that will be utilized for the DictionaryPage itself based on the parquet
// version. V1 uses PlainDict, v2 uses Plain
func ( *WriterProperties) () Encoding {
	if .parquetVersion == V1_0 {
		return Encodings.PlainDict
	}
	return Encodings.Plain
}

// DictionaryEnabled returns the default value as for whether or not dictionary encoding will be utilized for columns
// that aren't separately specified.
func ( *WriterProperties) () bool { return .defColumnProps.DictionaryEnabled }

// DictionaryEnabledFor returns whether or not dictionary encoding will be used for the specified column when writing
// or the default value if the column was not separately specified.
func ( *WriterProperties) ( string) bool {
	if ,  := .columnProps[];  {
		return .DictionaryEnabled
	}
	return .defColumnProps.DictionaryEnabled
}

// DictionaryEnabledPath is the same as DictionaryEnabledFor but takes a ColumnPath object.
func ( *WriterProperties) ( ColumnPath) bool {
	return .DictionaryEnabledFor(.String())
}

// StatisticsEnabled returns the default value for whether or not stats are enabled to be written for columns
// that aren't separately specified.
func ( *WriterProperties) () bool { return .defColumnProps.StatsEnabled }

// StatisticsEnabledFor returns whether stats will be written for the given column path, or the default value if
// it wasn't separately specified.
func ( *WriterProperties) ( string) bool {
	if ,  := .columnProps[];  {
		return .StatsEnabled
	}
	return .defColumnProps.StatsEnabled
}

// StatisticsEnabledPath is the same as StatisticsEnabledFor but takes a ColumnPath object.
func ( *WriterProperties) ( ColumnPath) bool {
	return .StatisticsEnabledFor(.String())
}

// PageIndexEnabled returns the default value for whether or not page indexes will be written
func ( *WriterProperties) () bool { return .defColumnProps.PageIndexEnabled }

// PageIndexEnabledFor returns whether page index writing is enabled for the given column path, or
// the default value if it wasn't specified separately.
func ( *WriterProperties) ( string) bool {
	if ,  := .columnProps[];  {
		return .PageIndexEnabled
	}
	return .defColumnProps.PageIndexEnabled
}

// PageIndexEnabledPath is the same as PageIndexEnabledFor but takes a ColumnPath object
func ( *WriterProperties) ( ColumnPath) bool {
	return .PageIndexEnabledFor(.String())
}

// MaxStatsSize returns the default maximum size for stats
func ( *WriterProperties) () int64 { return .defColumnProps.MaxStatsSize }

// MaxStatsSizeFor returns the maximum stat size for the given column path
func ( *WriterProperties) ( string) int64 {
	if ,  := .columnProps[];  {
		return .MaxStatsSize
	}
	return .defColumnProps.MaxStatsSize
}

// MaxStatsSizePath is the same as MaxStatsSizeFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) int64 {
	return .MaxStatsSizeFor(.String())
}

// ColumnEncryptionProperties returns the specific properties for encryption that will be used for the given column path
func ( *WriterProperties) ( string) *ColumnEncryptionProperties {
	if .encryptionProps != nil {
		return .encryptionProps.ColumnEncryptionProperties()
	}
	return nil
}

// StoreDecimalAsInteger returns the config option controlling whether or not
// to try storing decimal data as an integer type if the precision is low enough
// (1 <= prec <= 18 can be stored as an int), otherwise it will be stored as
// a fixed len byte array.
func ( *WriterProperties) () bool {
	return .storeDecimalAsInt
}

// MaxBloomFilterBytes returns the maximum number of bytes that a bloom filter can use
func ( *WriterProperties) () int64 {
	return .maxBloomFilterBytes
}

// BloomFilterEnabled returns the default value for whether or not bloom filters are enabled
func ( *WriterProperties) () bool {
	return .defColumnProps.BloomFilterEnabled
}

// BloomFilterEnabledFor returns whether or not bloom filters are enabled for the given column path
func ( *WriterProperties) ( string) bool {
	if ,  := .columnProps[];  {
		return .BloomFilterEnabled
	}
	return .defColumnProps.BloomFilterEnabled
}

// BloomFilterEnabledPath is the same as BloomFilterEnabledFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) bool {
	return .BloomFilterEnabledFor(.String())
}

// BloomFilterFPP returns the default false positive probability for bloom filters
func ( *WriterProperties) () float64 {
	return .defColumnProps.BloomFilterFPP
}

// BloomFilterFPPFor returns the false positive probability for the given column path
func ( *WriterProperties) ( string) float64 {
	if ,  := .columnProps[];  {
		return .BloomFilterFPP
	}
	return .defColumnProps.BloomFilterFPP
}

// BloomFilterFPPPath is the same as BloomFilterFPPFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) float64 {
	return .BloomFilterFPPFor(.String())
}

// AdaptiveBloomFilterEnabled returns the default value for whether or not adaptive bloom filters are enabled
func ( *WriterProperties) () bool {
	return .defColumnProps.AdaptiveBloomFilterEnabled
}

// AdaptiveBloomFilterEnabledFor returns whether or not adaptive bloom filters are enabled for the given column path
func ( *WriterProperties) ( string) bool {
	if ,  := .columnProps[];  {
		return .AdaptiveBloomFilterEnabled
	}
	return .defColumnProps.AdaptiveBloomFilterEnabled
}

// AdaptiveBloomFilterEnabledPath is the same as AdaptiveBloomFilterEnabledFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) bool {
	return .AdaptiveBloomFilterEnabledFor(.String())
}

// BloomFilterCandidates returns the default number of candidates to use for bloom filters
func ( *WriterProperties) () int {
	return .defColumnProps.BloomFilterCandidates
}

// BloomFilterCandidatesFor returns the number of candidates to use for the given column path
func ( *WriterProperties) ( string) int {
	if ,  := .columnProps[];  {
		return .BloomFilterCandidates
	}
	return .defColumnProps.BloomFilterCandidates
}

// BloomFilterCandidatesPath is the same as BloomFilterCandidatesFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) int {
	return .BloomFilterCandidatesFor(.String())
}

// BloomFilterNDV returns the default number of distinct values to use for bloom filters
func ( *WriterProperties) () int64 {
	return .defColumnProps.BloomFilterNDV
}

// BloomFilterNDVFor returns the number of distinct values to use for the given column path
func ( *WriterProperties) ( string) int64 {
	if ,  := .columnProps[];  {
		return .BloomFilterNDV
	}
	return .defColumnProps.BloomFilterNDV
}

// BloomFilterNDVPath is the same as BloomFilterNDVFor but takes a ColumnPath
func ( *WriterProperties) ( ColumnPath) int64 {
	return .BloomFilterNDVFor(.String())
}