wgtmac commented on code in PR #1307:
URL: https://github.com/apache/orc/pull/1307#discussion_r1015546519
##########
c++/src/ColumnWriter.cc:
##########
@@ -456,126 +456,107 @@ namespace orc {
}
}
+ template <typename BatchType, typename IntType>
class IntegerColumnWriter : public ColumnWriter {
public:
IntegerColumnWriter(
const Type& type,
const StreamsFactory& factory,
- const WriterOptions& options);
+ const WriterOptions& options) :
+ ColumnWriter(type, factory, options),
+ rleVersion(options.getRleVersion()) {
+ std::unique_ptr<BufferedOutputStream> dataStream =
+ factory.createStream(proto::Stream_Kind_DATA);
+ rleEncoder = createRleEncoder(
+ std::move(dataStream),
+ true,
+ rleVersion,
+ memPool,
+ options.getAlignedBitpacking());
+
+ if (enableIndex) {
+ recordPosition();
+ }
+ }
virtual void add(ColumnVectorBatch& rowBatch,
uint64_t offset,
uint64_t numValues,
- const char* incomingMask) override;
-
- virtual void flush(std::vector<proto::Stream>& streams) override;
-
- virtual uint64_t getEstimatedSize() const override;
+ const char* incomingMask) override {
+ const BatchType* intBatch =
+ dynamic_cast<const BatchType*>(&rowBatch);
+ if (intBatch == nullptr) {
+ throw InvalidArgument("Failed to cast to LongVectorBatch");
Review Comment:
It may not be LongVectorBatch now. This error message should be changed as
well.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]