prtkgaur commented on code in PR #48345:
URL: https://github.com/apache/arrow/pull/48345#discussion_r3921390201
##########
cpp/src/parquet/decoder.cc:
##########
@@ -2372,6 +2375,130 @@ class ByteStreamSplitDecoder<FLBAType> : public
ByteStreamSplitDecoderBase<FLBAT
}
};
+// ----------------------------------------------------------------------
+// ALP decoder (Adaptive Lossless floating-Point)
+
+template <typename DType>
+class AlpDecoder : public TypedDecoderImpl<DType> {
+ public:
+ using Base = TypedDecoderImpl<DType>;
+ using T = typename DType::c_type;
+
+ // TODO: support incremental decode. Partial reads currently decode the
entire
Review Comment:
Agreed, and done. `VectorReader` validates the header and the whole offset
chain once in `Open` and then decodes any single vector on demand, so `Decode`
is `Open` plus a loop and both paths share one validator instead of having one
each — a few lines longer than the whole-page version rather than shorter.
A vector entered at its first value and read to its end decodes straight
into the caller's buffer; anything else goes through one vector of scratch. So
the decoder holds 4 or 8 KB rather than a page, pool-backed and allocated on
first use — which also answers your scratch-buffer comment.
`TestAlpEncoding.BatchedDecode` covers six batch plans over a 2000-value page.
--
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]