This is an automated email from the ASF dual-hosted git repository.
gangwu pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/branch-1.9 by this push:
new 5c5415771 ORC-1457: [C++] Fix ambiguous overload of
Type::createRowBatch
5c5415771 is described below
commit 5c5415771953760930ecb6ebbd3c0478a8d917ff
Author: Gang Wu <[email protected]>
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 <[email protected]>
Signed-off-by: Gang Wu <[email protected]>
(cherry picked from commit 81b955e7b2cf2ded99f52d7a5c6684a2886f6188)
Signed-off-by: Gang Wu <[email protected]>
---
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,