@@ -53,28 +53,76 @@ public long Close()
5353 return ExceptionInfo . Return < long > ( Handle , ColumnWriter_Close ) ;
5454 }
5555
56+ /// <summary>
57+ /// Get the index of the column within the row group.
58+ /// </summary>
5659 public int ColumnIndex { get ; }
60+ /// <summary>
61+ /// Get the <see cref="ParquetSharp.LogicalTypeFactory"/> for the Parquet file writer.
62+ /// </summary>
5763 public LogicalTypeFactory LogicalTypeFactory => RowGroupWriter . ParquetFileWriter . LogicalTypeFactory ;
64+ /// <summary>
65+ /// Get the <see cref="ParquetSharp.LogicalWriteConverterFactory"/> for the Parquet file writer.
66+ /// </summary>
5867 public LogicalWriteConverterFactory LogicalWriteConverterFactory => RowGroupWriter . ParquetFileWriter . LogicalWriteConverterFactory ;
5968
69+ /// <summary>
70+ /// Get the <see cref="ParquetSharp.ColumnDescriptor"/> for the column.
71+ /// </summary>
6072 public ColumnDescriptor ColumnDescriptor => new ( ExceptionInfo . Return < IntPtr > ( Handle , ColumnWriter_Descr ) ) ;
73+ /// <summary>
74+ /// Get the number of rows written to the column so far.
75+ /// </summary>
6176 public long RowWritten => ExceptionInfo . Return < long > ( Handle , ColumnWriter_Rows_Written ) ;
77+ /// <summary>
78+ /// Get the physical type of the column.
79+ /// </summary>
6280 public PhysicalType Type => ExceptionInfo . Return < PhysicalType > ( Handle , ColumnWriter_Type ) ;
81+ /// <summary>
82+ /// Get the <see cref="ParquetSharp.WriterProperties"/> for the column.
83+ /// </summary>
6384 public WriterProperties WriterProperties => new ( ExceptionInfo . Return < IntPtr > ( Handle , ColumnWriter_Properties ) ) ;
6485
86+ /// <summary>
87+ /// Get the element <see cref="Type"/> of the data being written.
88+ /// </summary>
6589 public abstract Type ElementType { get ; }
90+
91+ /// <summary>
92+ /// Apply a visitor to the column writer.
93+ /// </summary>
94+ /// <typeparam name="TReturn">The return type of the visitor.</typeparam>
95+ /// <param name="visitor">The visitor instance.</param>
96+ /// <returns>The result of the visitor operation.</returns>
6697 public abstract TReturn Apply < TReturn > ( IColumnWriterVisitor < TReturn > visitor ) ;
6798
99+ /// <summary>
100+ /// Create a <see cref="LogicalColumnWriter"/>.
101+ /// </summary>
102+ /// <param name="bufferLength">The buffer length in bytes. Default is 4KB.</param>
103+ /// <returns>A <see cref="LogicalColumnWriter"/> instance.</returns>
68104 public LogicalColumnWriter LogicalWriter ( int bufferLength = 4 * 1024 )
69105 {
70106 return LogicalColumnWriter . Create ( this , bufferLength , elementTypeOverride : null ) ;
71107 }
72108
109+ /// <summary>
110+ /// Create a strongly-typed <see cref="LogicalColumnWriter"/> without an explicit element type override.
111+ /// </summary>
112+ /// <typeparam name="TElement">The type of the data to write.</typeparam>
113+ /// <param name="bufferLength">The buffer length in bytes. Default is 4KB.</param>
114+ /// <returns>A <see cref="LogicalColumnWriter"/> instance.</returns>
73115 public LogicalColumnWriter < TElement > LogicalWriter < TElement > ( int bufferLength = 4 * 1024 )
74116 {
75117 return LogicalColumnWriter . Create < TElement > ( this , bufferLength , elementTypeOverride : null ) ;
76118 }
77119
120+ /// <summary>
121+ /// Create a strongly-typed <see cref="LogicalColumnWriter"/> with an explicit element type override.
122+ /// </summary>
123+ /// <typeparam name="TElement">The type of the data to write.</typeparam>
124+ /// <param name="bufferLength">The buffer length in bytes. Default is 4KB.</param>
125+ /// <returns>A <see cref="LogicalColumnWriter"/> instance.</returns>
78126 public LogicalColumnWriter < TElement > LogicalWriterOverride < TElement > ( int bufferLength = 4 * 1024 )
79127 {
80128 return LogicalColumnWriter . Create < TElement > ( this , bufferLength , typeof ( TElement ) ) ;
@@ -181,26 +229,48 @@ protected IntPtr Handle
181229 internal readonly RowGroupWriter RowGroupWriter ;
182230 }
183231
184- /// <inheritdoc />
232+ /// <summary>
233+ /// Strongly-typed writer of physical Parquet values to a single column.
234+ /// </summary>
235+ /// <typeparam name="TValue">The data type of the column.</typeparam>
185236 public sealed class ColumnWriter < TValue > : ColumnWriter where TValue : unmanaged
186237 {
187238 internal ColumnWriter ( IntPtr handle , RowGroupWriter rowGroupWriter , int columnIndex )
188239 : base ( handle , rowGroupWriter , columnIndex )
189240 {
190241 }
191242
243+ /// <inheritdoc />
192244 public override Type ElementType => typeof ( TValue ) ;
193245
246+ /// <inheritdoc />
194247 public override TReturn Apply < TReturn > ( IColumnWriterVisitor < TReturn > visitor )
195248 {
196249 return visitor . OnColumnWriter ( this ) ;
197250 }
198251
252+ /// <summary>
253+ /// Write a batch of values to the column.
254+ /// </summary>
255+ /// <param name="values">The values to write.</param>
199256 public void WriteBatch ( ReadOnlySpan < TValue > values )
200257 {
201258 WriteBatch ( values . Length , null , null , values ) ;
202259 }
203260
261+ /// <summary>
262+ /// Write a batch of values to the column with optional definition and repetition levels.
263+ /// </summary>
264+ /// <param name="numValues">The number of values to write.</param>
265+ /// <param name="defLevels">The definition levels for the values.</param>
266+ /// <param name="repLevels">The repetition levels for the values.</param>
267+ /// <param name="values">The values to write.</param>
268+ /// <remarks>
269+ /// The lengths of <paramref name="defLevels"/> and <paramref name="repLevels"/> must be at least <paramref name="numValues"/>.
270+ /// </remarks>
271+ /// <exception cref="ArgumentNullException">Thrown if <paramref name="values"/> is null.</exception>
272+ /// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="numValues"/> is larger
273+ /// than the length of <paramref name="defLevels"/> or <paramref name="repLevels"/>.</exception>
204274 public unsafe void WriteBatch ( int numValues , ReadOnlySpan < short > defLevels , ReadOnlySpan < short > repLevels , ReadOnlySpan < TValue > values )
205275 {
206276 if ( values == null ) throw new ArgumentNullException ( nameof ( values ) ) ;
0 commit comments