You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by ga...@apache.org on 2023/06/30 08:34:25 UTC

[orc] branch main updated: ORC-1457: [C++] Fix ambiguous overload of Type::createRowBatch

This is an automated email from the ASF dual-hosted git repository.

gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/main by this push:
     new 81b955e7b ORC-1457: [C++] Fix ambiguous overload of Type::createRowBatch
81b955e7b is described below

commit 81b955e7b2cf2ded99f52d7a5c6684a2886f6188
Author: Gang Wu <us...@gmail.com>
AuthorDate: Fri Jun 30 16:34:13 2023 +0800

    ORC-1457: [C++] Fix ambiguous overload of Type::createRowBatch
    
    ### What changes were proposed in this pull request?
    
    Remove default parameters from one overload of Type::createRowBatch to eliminate ambiguity.
    
    ### Why are the changes needed?
    
    The overloads of Type::createRowBatch are ambiguous when default parameters are used.
    ```cpp
    virtual std::unique_ptr<ColumnVectorBatch> createRowBatch(
      uint64_t size, MemoryPool& pool, bool encoded = false) const = 0;
    
    virtual std::unique_ptr<ColumnVectorBatch> createRowBatch(
      uint64_t size, MemoryPool& pool, bool encoded = false,
      bool useTightNumericVector = false) const = 0;
    ```
    
    ### How was this patch tested?
    
    Make sure all tests pass.
    
    Closes #1557 from wgtmac/ORC-1457.
    
    Authored-by: Gang Wu <us...@gmail.com>
    Signed-off-by: Gang Wu <us...@gmail.com>
---
 c++/include/orc/Type.hh | 6 +++---
 c++/src/TypeImpl.cc     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/c++/include/orc/Type.hh b/c++/include/orc/Type.hh
index c8ada75c8..82e0e3cc8 100644
--- a/c++/include/orc/Type.hh
+++ b/c++/include/orc/Type.hh
@@ -78,9 +78,9 @@ namespace orc {
     virtual std::unique_ptr<ColumnVectorBatch> createRowBatch(uint64_t size, MemoryPool& pool,
                                                               bool encoded = false) const = 0;
 
-    virtual std::unique_ptr<ColumnVectorBatch> createRowBatch(
-        uint64_t size, MemoryPool& pool, bool encoded = false,
-        bool useTightNumericVector = false) const = 0;
+    virtual std::unique_ptr<ColumnVectorBatch> createRowBatch(uint64_t size, MemoryPool& pool,
+                                                              bool encoded,
+                                                              bool useTightNumericVector) const = 0;
 
     /**
      * Add a new field to a struct type.
diff --git a/c++/src/TypeImpl.cc b/c++/src/TypeImpl.cc
index 0fd640b2d..c914d84f4 100644
--- a/c++/src/TypeImpl.cc
+++ b/c++/src/TypeImpl.cc
@@ -279,7 +279,7 @@ namespace orc {
   std::unique_ptr<ColumnVectorBatch> TypeImpl::createRowBatch(uint64_t capacity,
                                                               MemoryPool& memoryPool,
                                                               bool encoded) const {
-    return createRowBatch(capacity, memoryPool, encoded, false);
+    return createRowBatch(capacity, memoryPool, encoded, /*useTightNumericVector=*/false);
   }
 
   std::unique_ptr<ColumnVectorBatch> TypeImpl::createRowBatch(uint64_t capacity,