Describe the enhancement requested
The ArrayBuilder::AppendScalar implementation is currently very odd:
- the
ArrayBuilder hierarchy uses polymorphism (i.e. virtual methods) to handle type-specific operations
- but
ArrayBuilder::AppendScalar is implemented entirely in the base class using a visitor, putting type-specific knowledge in the base class definition
- but
ArrayBuilder::AppendScalar is also a virtual method overriden in dictionary and run-end-encoded builders
- furthermore, the visitor in the base class definition of
ArrayBuilder::AppendScalar dispatched on the scalar's data type, instead of the builder's data type
We should refactor the AppendScalar implementation to be entirely polymorphic and remove any trace of type-specific implementations in the base class (ArrayBuilder::AppendScalar would probably become a pure virtual method).
This would also help in cases like #50584
Component(s)
C++
Describe the enhancement requested
The
ArrayBuilder::AppendScalarimplementation is currently very odd:ArrayBuilderhierarchy uses polymorphism (i.e. virtual methods) to handle type-specific operationsArrayBuilder::AppendScalaris implemented entirely in the base class using a visitor, putting type-specific knowledge in the base class definitionArrayBuilder::AppendScalaris also a virtual method overriden in dictionary and run-end-encoded buildersArrayBuilder::AppendScalardispatched on the scalar's data type, instead of the builder's data typeWe should refactor the
AppendScalarimplementation to be entirely polymorphic and remove any trace of type-specific implementations in the base class (ArrayBuilder::AppendScalarwould probably become a pure virtual method).This would also help in cases like #50584
Component(s)
C++