wgtmac commented on code in PR #2010:
URL: https://github.com/apache/orc/pull/2010#discussion_r1730821959


##########
c++/include/orc/Vector.hh:
##########
@@ -248,10 +249,15 @@ namespace orc {
     ~EncodedStringVectorBatch() override;
     std::string toString() const override;
     void resize(uint64_t capacity) override;
+
+    // Calculate data and length in StringVectorBatch from dictionary and index
+    void calculateDataAndLength();
+
     std::shared_ptr<StringDictionary> dictionary;
 
     // index for dictionary entry
     DataBuffer<int64_t> index;
+    std::atomic<bool> calculated{false};

Review Comment:
   Should we replace it with `std::call_once`?



##########
c++/include/orc/Vector.hh:
##########
@@ -248,10 +249,15 @@ namespace orc {
     ~EncodedStringVectorBatch() override;
     std::string toString() const override;
     void resize(uint64_t capacity) override;
+
+    // Calculate data and length in StringVectorBatch from dictionary and index
+    void calculateDataAndLength();

Review Comment:
   BTW, should we move it to the parent `ColumnVectorBatch` class so we can 
decode dictionaries in a single shot and do not bother with multiple 
`dynamic_cast` calls in the writer implementation?



##########
c++/include/orc/Vector.hh:
##########
@@ -248,10 +249,15 @@ namespace orc {
     ~EncodedStringVectorBatch() override;
     std::string toString() const override;
     void resize(uint64_t capacity) override;
+
+    // Calculate data and length in StringVectorBatch from dictionary and index
+    void calculateDataAndLength();

Review Comment:
   What about renaming it into `decodeDictionary()`?



-- 
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]

Reply via email to