mr-smidge commented on a change in pull request #7654:
URL: https://github.com/apache/arrow/pull/7654#discussion_r453675969
##########
File path: csharp/src/Apache.Arrow/Arrays/DelegatingArrayBuilder.cs
##########
@@ -0,0 +1,96 @@
+//------------------------------------------------------------------------------
+// <copyright file="DelegatingArrayBuilder.cs" company="Jetstone Asset
Management LLP">
+// Copyright (C) Jetstone Asset Management LLP. All rights reserved.
+// Unauthorised copying of this file, via any medium, is strictly prohibited.
+// Proprietary and confidential
+// </copyright>
+// <author>Adam Szmigin</author>
+//------------------------------------------------------------------------------
+
+using System;
+using Apache.Arrow.Memory;
+
+namespace Apache.Arrow
+{
+ /// <summary>
+ /// The <see cref="DelegatingArrayBuilder{T,TArray,TBuilder}"/> class can
be used as the base for any array builder
+ /// that needs to delegate most of its functionality to an inner array
builder.
+ /// </summary>
+ /// <remarks>
+ /// The typical use case is when an array builder may accept a number of
different types as input, but which are
+ /// all internally converted to a single type for assembly into an array.
+ /// </remarks>
+ /// <typeparam name="T">Type of item accepted by inner array
builder.</typeparam>
+ /// <typeparam name="TArray">Type of array produced by this (and the
inner) builder.</typeparam>
+ /// <typeparam name="TBuilder">Type of builder (see Curiously-Recurring
Template Pattern).</typeparam>
+ public abstract class DelegatingArrayBuilder<T, TArray, TBuilder> :
IArrowArrayBuilder<TArray, TBuilder>
Review comment:
Perhaps `PrimitiveArrayBuilder<TFrom, TTo, ...>` could now use this as
a base class?
The issue is that the only remaining user of `PrimitiveArrayBuilder<TFrom,
TTo, ...>` is now `TimestampArray`, and that class has a number of problems
that mean it may need to be refactored to derive from a different base class
(in short: it needs to understand IANA/Olson timezone identifiers, and NodaTime
is the obvious library to do that, but if we include NodaTime then the class
might as well accept `NodaTime.Instant`, etc). This made me think that
`PrimitiveArrayBuilder<TFrom, TTo, ...>` should probably be marked obsolete.
Opinions welcomed!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]