This is an automated email from the ASF dual-hosted git repository.
rui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 731c5b5826 [VL] Minor fix for cpp code style (part 1) (#8157)
731c5b5826 is described below
commit 731c5b5826a24ef789a3bbaa9f16cc91f562422c
Author: Rui Mo <[email protected]>
AuthorDate: Thu Dec 5 22:32:16 2024 +0800
[VL] Minor fix for cpp code style (part 1) (#8157)
---
cpp/CMakeLists.txt | 3 -
cpp/velox/CMakeLists.txt | 16 ++---
cpp/velox/compute/WholeStageResultIterator.h | 2 +-
cpp/velox/jni/JniFileSystem.h | 6 +-
cpp/velox/memory/VeloxMemoryManager.cc | 1 +
.../functions/RegistrationAllFunctions.cc | 2 +
.../operators/functions/RowConstructorWithNull.cc | 2 +
.../operators/functions/RowConstructorWithNull.h | 2 +
.../operators/functions/RowFunctionWithNull.h | 6 +-
.../functions/SparkExprToSubfieldFilterParser.cc | 1 +
.../functions/SparkExprToSubfieldFilterParser.h | 1 +
cpp/velox/operators/plannodes/RowVectorStream.h | 7 +-
cpp/velox/operators/reader/FileReaderIterator.cc | 1 +
cpp/velox/operators/reader/FileReaderIterator.h | 1 +
.../operators/reader/ParquetReaderIterator.cc | 3 +-
.../serializer/VeloxColumnarBatchSerializer.cc | 4 +-
.../serializer/VeloxRowToColumnarConverter.cc | 2 +
cpp/velox/operators/writer/VeloxArrowWriter.cc | 1 +
cpp/velox/operators/writer/VeloxArrowWriter.h | 2 +
.../operators/writer/VeloxParquetDataSource.cc | 1 -
.../operators/writer/VeloxParquetDataSourceABFS.h | 1 +
.../operators/writer/VeloxParquetDataSourceGCS.h | 2 +
.../operators/writer/VeloxParquetDataSourceHDFS.h | 1 +
.../operators/writer/VeloxParquetDataSourceS3.h | 1 +
cpp/velox/shuffle/GlutenByteStream.h | 2 +
cpp/velox/shuffle/RadixSort.h | 84 ++++++++++------------
cpp/velox/shuffle/VeloxShuffleWriter.cc | 2 +
cpp/velox/shuffle/VeloxSortShuffleWriter.cc | 4 +-
cpp/velox/shuffle/VeloxSortShuffleWriter.h | 1 +
.../substrait/SubstraitToVeloxPlanValidator.cc | 2 +-
cpp/velox/substrait/TypeUtils.h | 1 +
cpp/velox/substrait/VariantToVectorConverter.cc | 1 +
cpp/velox/substrait/VeloxToSubstraitPlan.cc | 1 -
cpp/velox/tests/BufferOutputStreamTest.cc | 2 +
cpp/velox/tests/FunctionTest.cc | 2 +
cpp/velox/tests/MemoryManagerTest.cc | 2 +
cpp/velox/tests/SparkFunctionTest.cc | 1 +
.../tests/Substrait2VeloxPlanConversionTest.cc | 2 +
.../tests/Substrait2VeloxPlanValidatorTest.cc | 2 +
.../Substrait2VeloxValuesNodeConversionTest.cc | 2 +
cpp/velox/tests/VeloxBatchResizerTest.cc | 1 +
.../tests/VeloxColumnarBatchSerializerTest.cc | 1 +
cpp/velox/tests/VeloxColumnarBatchTest.cc | 1 +
cpp/velox/tests/VeloxColumnarToRowTest.cc | 2 +
cpp/velox/tests/VeloxRowToColumnarTest.cc | 2 +
cpp/velox/tests/VeloxShuffleWriterTest.cc | 2 +-
cpp/velox/tests/VeloxSubstraitRoundTripTest.cc | 1 +
cpp/velox/tests/VeloxToSubstraitTypeTest.cc | 1 +
cpp/velox/udf/Udaf.h | 1 +
cpp/velox/udf/UdfLoader.h | 1 +
cpp/velox/udf/examples/MyUDAF.cc | 1 +
cpp/velox/udf/examples/MyUDF.cc | 2 +
cpp/velox/utils/HdfsUtils.cc | 3 +
cpp/velox/utils/VeloxBatchResizer.cc | 3 +-
cpp/velox/utils/VeloxBatchResizer.h | 2 +
cpp/velox/utils/tests/MemoryPoolUtils.cc | 3 +-
cpp/velox/utils/tests/MemoryPoolUtils.h | 8 +--
57 files changed, 133 insertions(+), 82 deletions(-)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index e0ab141a1f..5cc1d4ee4b 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -236,10 +236,7 @@ if(ENABLE_IAA)
add_definitions(-DGLUTEN_ENABLE_IAA)
endif()
-#
# Subdirectories
-#
-
add_subdirectory(core)
if(BUILD_VELOX_BACKEND)
diff --git a/cpp/velox/CMakeLists.txt b/cpp/velox/CMakeLists.txt
index 17b824b619..4dc5ec0aff 100644
--- a/cpp/velox/CMakeLists.txt
+++ b/cpp/velox/CMakeLists.txt
@@ -140,12 +140,12 @@ endmacro()
set(VELOX_SRCS
compute/VeloxBackend.cc
compute/VeloxRuntime.cc
- compute/WholeStageResultIterator.cc
compute/VeloxPlanConverter.cc
+ compute/WholeStageResultIterator.cc
compute/iceberg/IcebergPlanConverter.cc
- jni/VeloxJniWrapper.cc
jni/JniFileSystem.cc
jni/JniUdf.cc
+ jni/VeloxJniWrapper.cc
memory/BufferOutputStream.cc
memory/VeloxColumnarBatch.cc
memory/VeloxMemoryManager.cc
@@ -154,30 +154,30 @@ set(VELOX_SRCS
operators/functions/SparkExprToSubfieldFilterParser.cc
operators/reader/FileReaderIterator.cc
operators/reader/ParquetReaderIterator.cc
- operators/serializer/VeloxColumnarToRowConverter.cc
operators/serializer/VeloxColumnarBatchSerializer.cc
+ operators/serializer/VeloxColumnarToRowConverter.cc
operators/serializer/VeloxRowToColumnarConverter.cc
operators/writer/VeloxArrowWriter.cc
operators/writer/VeloxParquetDataSource.cc
+ shuffle/VeloxHashShuffleWriter.cc
+ shuffle/VeloxRssSortShuffleWriter.cc
shuffle/VeloxShuffleReader.cc
shuffle/VeloxShuffleWriter.cc
- shuffle/VeloxHashShuffleWriter.cc
shuffle/VeloxSortShuffleWriter.cc
- shuffle/VeloxRssSortShuffleWriter.cc
+ substrait/SubstraitExtensionCollector.cc
substrait/SubstraitParser.cc
substrait/SubstraitToVeloxExpr.cc
substrait/SubstraitToVeloxPlan.cc
substrait/SubstraitToVeloxPlanValidator.cc
substrait/VariantToVectorConverter.cc
- substrait/SubstraitExtensionCollector.cc
substrait/VeloxSubstraitSignature.cc
substrait/VeloxToSubstraitExpr.cc
substrait/VeloxToSubstraitPlan.cc
substrait/VeloxToSubstraitType.cc
udf/UdfLoader.cc
- utils/VeloxArrowUtils.cc
- utils/ConfigExtractor.cc
utils/Common.cc
+ utils/ConfigExtractor.cc
+ utils/VeloxArrowUtils.cc
utils/VeloxBatchResizer.cc)
if(ENABLE_S3)
diff --git a/cpp/velox/compute/WholeStageResultIterator.h
b/cpp/velox/compute/WholeStageResultIterator.h
index 9b1f2b7288..d0dd47bfd1 100644
--- a/cpp/velox/compute/WholeStageResultIterator.h
+++ b/cpp/velox/compute/WholeStageResultIterator.h
@@ -120,7 +120,7 @@ class WholeStageResultIterator : public
ColumnarBatchIterator {
/// All the children plan node ids with postorder traversal.
std::vector<facebook::velox::core::PlanNodeId> orderedNodeIds_;
- /// Node ids should be ommited in metrics.
+ /// Node ids should be omitted in metrics.
std::unordered_set<facebook::velox::core::PlanNodeId> omittedNodeIds_;
std::vector<facebook::velox::core::PlanNodeId> scanNodeIds_;
std::vector<std::shared_ptr<SplitInfo>> scanInfos_;
diff --git a/cpp/velox/jni/JniFileSystem.h b/cpp/velox/jni/JniFileSystem.h
index 9313e7af7b..11c0f27b36 100644
--- a/cpp/velox/jni/JniFileSystem.h
+++ b/cpp/velox/jni/JniFileSystem.h
@@ -24,9 +24,9 @@
namespace gluten {
-// Register JNI-or-local (or JVM-over-local, as long as it describes what
happens here)
-// file system. maxFileSize is necessary (!= 0) because we use this size to
decide
-// whether a new file can fit in JVM heap, otherwise we write it via local
fs directly.
+// Register JNI-or-local (or JVM-over-local, as long as it describes what
happens here) file system. maxFileSize is
+// necessary (!= 0) because we use this size to decide whether a new file can
fit in JVM heap, otherwise we write it via
+// local fs directly.
void registerJolFileSystem(uint64_t maxFileSize);
void initVeloxJniFileSystem(JNIEnv* env);
diff --git a/cpp/velox/memory/VeloxMemoryManager.cc
b/cpp/velox/memory/VeloxMemoryManager.cc
index 63a61ae2dd..5e6fdd08a2 100644
--- a/cpp/velox/memory/VeloxMemoryManager.cc
+++ b/cpp/velox/memory/VeloxMemoryManager.cc
@@ -59,6 +59,7 @@ T getConfig(
return defaultValue;
}
} // namespace
+
/// We assume in a single Spark task. No thread-safety should be guaranteed.
class ListenableArbitrator : public velox::memory::MemoryArbitrator {
public:
diff --git a/cpp/velox/operators/functions/RegistrationAllFunctions.cc
b/cpp/velox/operators/functions/RegistrationAllFunctions.cc
index 06147d6d43..5d46dbdcdd 100644
--- a/cpp/velox/operators/functions/RegistrationAllFunctions.cc
+++ b/cpp/velox/operators/functions/RegistrationAllFunctions.cc
@@ -43,8 +43,10 @@ void registerPrestoVectorFunctions() {
VELOX_REGISTER_VECTOR_FUNCTION(udf_transform_values, "transform_values");
}
} // namespace facebook::velox::functions
+
namespace gluten {
namespace {
+
void registerFunctionOverwrite() {
velox::functions::registerUnaryNumeric<RoundFunction>({"round"});
velox::registerFunction<RoundFunction, int8_t, int8_t, int32_t>({"round"});
diff --git a/cpp/velox/operators/functions/RowConstructorWithNull.cc
b/cpp/velox/operators/functions/RowConstructorWithNull.cc
index e8b8a28836..4d052e0df2 100644
--- a/cpp/velox/operators/functions/RowConstructorWithNull.cc
+++ b/cpp/velox/operators/functions/RowConstructorWithNull.cc
@@ -19,6 +19,7 @@
#include "velox/expression/VectorFunction.h"
namespace gluten {
+
facebook::velox::TypePtr RowConstructorWithNullCallToSpecialForm::resolveType(
const std::vector<facebook::velox::TypePtr>& argTypes) {
auto numInput = argTypes.size();
@@ -52,4 +53,5 @@ facebook::velox::exec::ExprPtr
RowConstructorWithNullCallToSpecialForm::construc
return std::make_shared<facebook::velox::exec::Expr>(
type, std::move(compiledChildren), function, metadata, name,
trackCpuUsage);
}
+
} // namespace gluten
diff --git a/cpp/velox/operators/functions/RowConstructorWithNull.h
b/cpp/velox/operators/functions/RowConstructorWithNull.h
index 66b745e3ed..2565ba42f3 100644
--- a/cpp/velox/operators/functions/RowConstructorWithNull.h
+++ b/cpp/velox/operators/functions/RowConstructorWithNull.h
@@ -21,6 +21,7 @@
#include "velox/expression/SpecialForm.h"
namespace gluten {
+
class RowConstructorWithNullCallToSpecialForm : public
facebook::velox::exec::FunctionCallToSpecialForm {
public:
RowConstructorWithNullCallToSpecialForm(const std::string& rowFunctionName) {
@@ -49,4 +50,5 @@ class RowConstructorWithNullCallToSpecialForm : public
facebook::velox::exec::Fu
private:
std::string rowFunctionName;
};
+
} // namespace gluten
diff --git a/cpp/velox/operators/functions/RowFunctionWithNull.h
b/cpp/velox/operators/functions/RowFunctionWithNull.h
index 4131fb472d..6477449fb0 100644
--- a/cpp/velox/operators/functions/RowFunctionWithNull.h
+++ b/cpp/velox/operators/functions/RowFunctionWithNull.h
@@ -22,10 +22,8 @@
namespace gluten {
-/**
- * @tparam allNull If true, set struct as null when all of arguments are all,
else will
- * set it null when one of its arguments is null.
- */
+///@tparam allNull If true, set struct as null when all of arguments are all,
else will
+/// set it null when one of its arguments is null.
template <bool allNull>
class RowFunctionWithNull final : public facebook::velox::exec::VectorFunction
{
public:
diff --git a/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.cc
b/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.cc
index 8ad537d816..26614690e1 100644
--- a/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.cc
+++ b/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.cc
@@ -100,4 +100,5 @@ std::unique_ptr<common::Filter>
SparkExprToSubfieldFilterParser::leafCallToSubfi
}
return nullptr;
}
+
} // namespace gluten
diff --git a/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.h
b/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.h
index d050091c07..11e1b401a2 100644
--- a/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.h
+++ b/cpp/velox/operators/functions/SparkExprToSubfieldFilterParser.h
@@ -34,4 +34,5 @@ class SparkExprToSubfieldFilterParser : public
facebook::velox::exec::ExprToSubf
// Compared to the upstream 'toSubfield', the push-down of filter on nested
field is disabled.
bool toSparkSubfield(const facebook::velox::core::ITypedExpr* field,
facebook::velox::common::Subfield& subfield);
};
+
} // namespace gluten
diff --git a/cpp/velox/operators/plannodes/RowVectorStream.h
b/cpp/velox/operators/plannodes/RowVectorStream.h
index 63ddd0abe0..d503eb2d14 100644
--- a/cpp/velox/operators/plannodes/RowVectorStream.h
+++ b/cpp/velox/operators/plannodes/RowVectorStream.h
@@ -24,6 +24,7 @@
#include "velox/exec/Task.h"
namespace {
+
class SuspendedSection {
public:
explicit SuspendedSection(facebook::velox::exec::Driver* driver) :
driver_(driver) {
@@ -42,9 +43,11 @@ class SuspendedSection {
private:
facebook::velox::exec::Driver* const driver_;
};
+
} // namespace
namespace gluten {
+
class RowVectorStream {
public:
explicit RowVectorStream(
@@ -67,7 +70,7 @@ class RowVectorStream {
// possibility that this spill call hangs. See
https://github.com/apache/incubator-gluten/issues/7243.
// As of now, non-zero running threads usually happens when:
// 1. Task A spills task B;
- // 2. Task A trys to grow buffers created by task B, during which spill
is requested on task A again.
+ // 2. Task A tries to grow buffers created by task B, during which spill
is requested on task A again.
SuspendedSection ss(driverCtx_->driver);
hasNext = iterator_->hasNext();
}
@@ -77,7 +80,7 @@ class RowVectorStream {
return hasNext;
}
- // Convert arrow batch to rowvector and use new output columns
+ // Convert arrow batch to row vector and use new output columns
facebook::velox::RowVectorPtr next() {
if (finished_) {
return nullptr;
diff --git a/cpp/velox/operators/reader/FileReaderIterator.cc
b/cpp/velox/operators/reader/FileReaderIterator.cc
index d732adbf33..49d52f5ffd 100644
--- a/cpp/velox/operators/reader/FileReaderIterator.cc
+++ b/cpp/velox/operators/reader/FileReaderIterator.cc
@@ -49,4 +49,5 @@ std::shared_ptr<gluten::ResultIterator>
FileReaderIterator::getInputIteratorFrom
}
throw new GlutenException("Unreachable.");
}
+
} // namespace gluten
diff --git a/cpp/velox/operators/reader/FileReaderIterator.h
b/cpp/velox/operators/reader/FileReaderIterator.h
index e782c2bf80..708120603e 100644
--- a/cpp/velox/operators/reader/FileReaderIterator.h
+++ b/cpp/velox/operators/reader/FileReaderIterator.h
@@ -22,6 +22,7 @@
#include "velox/common/memory/MemoryPool.h"
namespace gluten {
+
enum FileReaderType { kBuffered, kStream, kNone };
class FileReaderIterator : public ColumnarBatchIterator {
diff --git a/cpp/velox/operators/reader/ParquetReaderIterator.cc
b/cpp/velox/operators/reader/ParquetReaderIterator.cc
index 3e61e1d8d9..014bccbfce 100644
--- a/cpp/velox/operators/reader/ParquetReaderIterator.cc
+++ b/cpp/velox/operators/reader/ParquetReaderIterator.cc
@@ -94,4 +94,5 @@ void ParquetBufferedReaderIterator::collectBatches() {
auto endTime = std::chrono::steady_clock::now();
collectBatchTime_ +=
std::chrono::duration_cast<std::chrono::nanoseconds>(endTime -
startTime).count();
}
-} // namespace gluten
\ No newline at end of file
+
+} // namespace gluten
diff --git a/cpp/velox/operators/serializer/VeloxColumnarBatchSerializer.cc
b/cpp/velox/operators/serializer/VeloxColumnarBatchSerializer.cc
index 9c5d166a07..7b858cce21 100644
--- a/cpp/velox/operators/serializer/VeloxColumnarBatchSerializer.cc
+++ b/cpp/velox/operators/serializer/VeloxColumnarBatchSerializer.cc
@@ -30,14 +30,15 @@
using namespace facebook::velox;
namespace gluten {
-
namespace {
+
std::unique_ptr<ByteInputStream> toByteStream(uint8_t* data, int32_t size) {
std::vector<ByteRange> byteRanges;
byteRanges.push_back(ByteRange{data, size, 0});
auto byteStream = std::make_unique<BufferInputStream>(byteRanges);
return byteStream;
}
+
} // namespace
VeloxColumnarBatchSerializer::VeloxColumnarBatchSerializer(
@@ -89,4 +90,5 @@ std::shared_ptr<ColumnarBatch>
VeloxColumnarBatchSerializer::deserialize(uint8_t
serde_->deserialize(byteStream.get(), veloxPool_.get(), rowType_, &result,
&options_);
return std::make_shared<VeloxColumnarBatch>(result);
}
+
} // namespace gluten
diff --git a/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc
b/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc
index 5dec7db23a..19a2bbafd2 100644
--- a/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc
+++ b/cpp/velox/operators/serializer/VeloxRowToColumnarConverter.cc
@@ -255,6 +255,7 @@ bool supporteType(const RowTypePtr rowType) {
}
} // namespace
+
VeloxRowToColumnarConverter::VeloxRowToColumnarConverter(
struct ArrowSchema* cSchema,
std::shared_ptr<memory::MemoryPool> memoryPool)
@@ -301,4 +302,5 @@ VeloxRowToColumnarConverter::convertPrimitive(int64_t
numRows, int64_t* rowLengt
auto rowVector = std::make_shared<RowVector>(pool_.get(), rowType_,
BufferPtr(nullptr), numRows, std::move(columns));
return std::make_shared<VeloxColumnarBatch>(rowVector);
}
+
} // namespace gluten
diff --git a/cpp/velox/operators/writer/VeloxArrowWriter.cc
b/cpp/velox/operators/writer/VeloxArrowWriter.cc
index 565602d95c..e01c0aee9f 100644
--- a/cpp/velox/operators/writer/VeloxArrowWriter.cc
+++ b/cpp/velox/operators/writer/VeloxArrowWriter.cc
@@ -35,4 +35,5 @@ std::shared_ptr<ColumnarBatch>
VeloxArrowWriter::retrieveColumnarBatch() {
}
return reader_->next();
}
+
} // namespace gluten
diff --git a/cpp/velox/operators/writer/VeloxArrowWriter.h
b/cpp/velox/operators/writer/VeloxArrowWriter.h
index 8b79986287..e0a0861b3b 100644
--- a/cpp/velox/operators/writer/VeloxArrowWriter.h
+++ b/cpp/velox/operators/writer/VeloxArrowWriter.h
@@ -21,6 +21,7 @@
#include "operators/writer/ArrowWriter.h"
namespace gluten {
+
class VeloxArrowWriter : public ArrowWriter {
public:
explicit VeloxArrowWriter(const std::string& path, int64_t batchSize,
facebook::velox::memory::MemoryPool* pool);
@@ -32,4 +33,5 @@ class VeloxArrowWriter : public ArrowWriter {
facebook::velox::memory::MemoryPool* pool_;
std::unique_ptr<ParquetStreamReaderIterator> reader_{nullptr};
};
+
} // namespace gluten
diff --git a/cpp/velox/operators/writer/VeloxParquetDataSource.cc
b/cpp/velox/operators/writer/VeloxParquetDataSource.cc
index aeec1b4c82..07f49c06ed 100644
--- a/cpp/velox/operators/writer/VeloxParquetDataSource.cc
+++ b/cpp/velox/operators/writer/VeloxParquetDataSource.cc
@@ -38,7 +38,6 @@ using namespace facebook::velox::common;
using namespace facebook::velox::filesystems;
namespace gluten {
-
namespace {
const int32_t kGzipWindowBits4k = 12;
}
diff --git a/cpp/velox/operators/writer/VeloxParquetDataSourceABFS.h
b/cpp/velox/operators/writer/VeloxParquetDataSourceABFS.h
index 8a417e1c22..f8f6e5878c 100644
--- a/cpp/velox/operators/writer/VeloxParquetDataSourceABFS.h
+++ b/cpp/velox/operators/writer/VeloxParquetDataSourceABFS.h
@@ -51,4 +51,5 @@ class VeloxParquetDataSourceABFS final : public
VeloxParquetDataSource {
abfsFileSystem->openFileForWrite(filePath_, {{}, sinkPool_.get()}),
filePath_);
}
};
+
} // namespace gluten
diff --git a/cpp/velox/operators/writer/VeloxParquetDataSourceGCS.h
b/cpp/velox/operators/writer/VeloxParquetDataSourceGCS.h
index 579a425d18..80c224194c 100644
--- a/cpp/velox/operators/writer/VeloxParquetDataSourceGCS.h
+++ b/cpp/velox/operators/writer/VeloxParquetDataSourceGCS.h
@@ -32,6 +32,7 @@
#include "velox/dwio/common/Options.h"
namespace gluten {
+
class VeloxParquetDataSourceGCS final : public VeloxParquetDataSource {
public:
VeloxParquetDataSourceGCS(
@@ -48,4 +49,5 @@ class VeloxParquetDataSourceGCS final : public
VeloxParquetDataSource {
gcsFileSystem->openFileForWrite(filePath_, {{}, sinkPool_.get()}),
filePath_);
}
};
+
} // namespace gluten
diff --git a/cpp/velox/operators/writer/VeloxParquetDataSourceHDFS.h
b/cpp/velox/operators/writer/VeloxParquetDataSourceHDFS.h
index 053b3da2ff..5f61d9145f 100644
--- a/cpp/velox/operators/writer/VeloxParquetDataSourceHDFS.h
+++ b/cpp/velox/operators/writer/VeloxParquetDataSourceHDFS.h
@@ -48,4 +48,5 @@ class VeloxParquetDataSourceHDFS final : public
VeloxParquetDataSource {
sink_ = dwio::common::FileSink::create(filePath_, {.connectorProperties =
hiveConf, .pool = sinkPool_.get()});
}
};
+
} // namespace gluten
diff --git a/cpp/velox/operators/writer/VeloxParquetDataSourceS3.h
b/cpp/velox/operators/writer/VeloxParquetDataSourceS3.h
index 3082f82a91..788eda19e5 100644
--- a/cpp/velox/operators/writer/VeloxParquetDataSourceS3.h
+++ b/cpp/velox/operators/writer/VeloxParquetDataSourceS3.h
@@ -48,4 +48,5 @@ class VeloxParquetDataSourceS3 final : public
VeloxParquetDataSource {
sink_ = dwio::common::FileSink::create(filePath_, {.connectorProperties =
hiveConf, .pool = sinkPool_.get()});
}
};
+
} // namespace gluten
diff --git a/cpp/velox/shuffle/GlutenByteStream.h
b/cpp/velox/shuffle/GlutenByteStream.h
index 78ea7b905a..cc63b730eb 100644
--- a/cpp/velox/shuffle/GlutenByteStream.h
+++ b/cpp/velox/shuffle/GlutenByteStream.h
@@ -19,6 +19,7 @@
#include "velox/common/memory/ByteStream.h"
namespace facebook::velox {
+
class GlutenByteInputStream : public ByteInputStream {
protected:
/// TODO Remove after refactoring SpillInput.
@@ -264,4 +265,5 @@ inline int128_t GlutenByteInputStream::read<int128_t>() {
readBytes(reinterpret_cast<uint8_t*>(&value), sizeof(value));
return value;
}
+
} // namespace facebook::velox
diff --git a/cpp/velox/shuffle/RadixSort.h b/cpp/velox/shuffle/RadixSort.h
index 69b87346c5..aa078ccd06 100644
--- a/cpp/velox/shuffle/RadixSort.h
+++ b/cpp/velox/shuffle/RadixSort.h
@@ -27,21 +27,19 @@ namespace gluten {
//
https://github.com/apache/spark/blob/308669fc301916837bacb7c3ec1ecef93190c094/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/RadixSort.java#L25
class RadixSort {
public:
- /**
- * Sorts a given array of longs using least-significant-digit radix sort.
This routine assumes
- * you have extra space at the end of the array at least equal to the number
of records. The
- * sort is destructive and may relocate the data positioned within the array.
- *
- * @param array array of long elements followed by at least that many empty
slots.
- * @param numRecords number of data records in the array.
- * @param startByteIndex the first byte (in range [0, 7]) to sort each long
by, counting from the
- * least significant byte.
- * @param endByteIndex the last byte (in range [0, 7]) to sort each long by,
counting from the
- * least significant byte. Must be greater than
startByteIndex.
- *
- * @return The starting index of the sorted data within the given array. We
return this instead
- * of always copying the data back to position zero for efficiency.
- */
+ // Sorts a given array of longs using least-significant-digit radix sort.
This routine assumes
+ // you have extra space at the end of the array at least equal to the number
of records. The
+ // sort is destructive and may relocate the data positioned within the array.
+ //
+ // @param array array of long elements followed by at least that many empty
slots.
+ // @param numRecords number of data records in the array.
+ // @param startByteIndex the first byte (in range [0, 7]) to sort each long
by, counting from the
+ // least significant byte.
+ // @param endByteIndex the last byte (in range [0, 7]) to sort each long by,
counting from the
+ // least significant byte. Must be greater than
startByteIndex.
+ //
+ // @return The starting index of the sorted data within the given array. We
return this instead
+ // of always copying the data back to position zero for efficiency.
static int32_t sort(uint64_t* array, size_t size, int64_t numRecords,
int32_t startByteIndex, int32_t endByteIndex) {
assert(startByteIndex >= 0 && "startByteIndex should >= 0");
assert(endByteIndex <= 7 && "endByteIndex should <= 7");
@@ -66,17 +64,15 @@ class RadixSort {
}
private:
- /**
- * Performs a partial sort by copying data into destination offsets for each
byte value at the
- * specified byte offset.
- *
- * @param array array to partially sort.
- * @param numRecords number of data records in the array.
- * @param counts counts for each byte value. This routine destructively
modifies this array.
- * @param byteIdx the byte in a long to sort at, counting from the least
significant byte.
- * @param inIndex the starting index in the array where input data is
located.
- * @param outIndex the starting index where sorted output data should be
written.
- */
+ // Performs a partial sort by copying data into destination offsets for each
byte value at the
+ // specified byte offset.
+ //
+ // @param array array to partially sort.
+ // @param numRecords number of data records in the array.
+ // @param counts counts for each byte value. This routine destructively
modifies this array.
+ // @param byteIdx the byte in a long to sort at, counting from the least
significant byte.
+ // @param inIndex the starting index in the array where input data is
located.
+ // @param outIndex the starting index where sorted output data should be
written.
static void sortAtByte(
uint64_t* array,
int64_t numRecords,
@@ -94,17 +90,15 @@ class RadixSort {
}
}
- /**
- * Computes a value histogram for each byte in the given array.
- *
- * @param array array to count records in.
- * @param numRecords number of data records in the array.
- * @param startByteIndex the first byte to compute counts for (the prior are
skipped).
- * @param endByteIndex the last byte to compute counts for.
- *
- * @return a vector of eight 256-element count arrays, one for each byte
starting from the least
- * significant byte. If the byte does not need sorting the vector
entry will be empty.
- */
+ // Computes a value histogram for each byte in the given array.
+ //
+ // @param array array to count records in.
+ // @param numRecords number of data records in the array.
+ // @param startByteIndex the first byte to compute counts for (the prior are
skipped).
+ // @param endByteIndex the last byte to compute counts for.
+ //
+ // @return a vector of eight 256-element count arrays, one for each byte
starting from the least
+ // significant byte. If the byte does not need sorting the vector
entry will be empty.
static std::vector<std::vector<int64_t>>
getCounts(uint64_t* array, int64_t numRecords, int32_t startByteIndex,
int32_t endByteIndex) {
std::vector<std::vector<int64_t>> counts;
@@ -134,15 +128,13 @@ class RadixSort {
return counts;
}
- /**
- * Transforms counts into the proper output offsets for the sort type.
- *
- * @param counts counts for each byte value. This routine destructively
modifies this vector.
- * @param numRecords number of data records in the original data array.
- * @param outputOffset output offset in bytes from the base array object.
- *
- * @return the input counts vector.
- */
+ // Transforms counts into the proper output offsets for the sort type.
+ //
+ // @param counts counts for each byte value. This routine destructively
modifies this vector.
+ // @param numRecords number of data records in the original data array.
+ // @param outputOffset output offset in bytes from the base array object.
+ //
+ // @return the input counts vector.
static std::vector<int64_t>& transformCountsToOffsets(std::vector<int64_t>&
counts, int64_t outputOffset) {
assert(counts.size() == 256);
diff --git a/cpp/velox/shuffle/VeloxShuffleWriter.cc
b/cpp/velox/shuffle/VeloxShuffleWriter.cc
index 69fd6801df..06b59cf3eb 100644
--- a/cpp/velox/shuffle/VeloxShuffleWriter.cc
+++ b/cpp/velox/shuffle/VeloxShuffleWriter.cc
@@ -21,6 +21,7 @@
#include "shuffle/VeloxSortShuffleWriter.h"
namespace gluten {
+
arrow::Result<std::shared_ptr<VeloxShuffleWriter>> VeloxShuffleWriter::create(
ShuffleWriterType type,
uint32_t numPartitions,
@@ -43,4 +44,5 @@ arrow::Result<std::shared_ptr<VeloxShuffleWriter>>
VeloxShuffleWriter::create(
return arrow::Status::Invalid("Unsupported shuffle writer type: ",
std::to_string(type));
}
}
+
} // namespace gluten
diff --git a/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
b/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
index ab37c0be74..793130a58a 100644
--- a/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
+++ b/cpp/velox/shuffle/VeloxSortShuffleWriter.cc
@@ -25,8 +25,8 @@
#include "utils/Timer.h"
namespace gluten {
-
namespace {
+
constexpr uint32_t kMaskLower27Bits = (1 << 27) - 1;
constexpr uint64_t kMaskLower40Bits = (1UL << 40) - 1;
constexpr uint32_t kPartitionIdStartByteIndex = 5;
@@ -44,6 +44,7 @@ uint32_t extractPartitionId(uint64_t compactRowId) {
std::pair<uint32_t, uint32_t> extractPageNumberAndOffset(uint64_t
compactRowId) {
return {(compactRowId & kMaskLower40Bits) >> 27, compactRowId &
kMaskLower27Bits};
}
+
} // namespace
arrow::Result<std::shared_ptr<VeloxShuffleWriter>>
VeloxSortShuffleWriter::create(
@@ -449,4 +450,5 @@ void VeloxSortShuffleWriter::updateSpillMetrics(const
std::unique_ptr<InMemoryPa
metrics_.totalBytesToEvict += payload->rawSize();
}
}
+
} // namespace gluten
diff --git a/cpp/velox/shuffle/VeloxSortShuffleWriter.h
b/cpp/velox/shuffle/VeloxSortShuffleWriter.h
index 5b8cff452d..97c040ba59 100644
--- a/cpp/velox/shuffle/VeloxSortShuffleWriter.h
+++ b/cpp/velox/shuffle/VeloxSortShuffleWriter.h
@@ -131,4 +131,5 @@ class VeloxSortShuffleWriter final : public
VeloxShuffleWriter {
int64_t sortTime_{0};
bool stopped_{false};
};
+
} // namespace gluten
diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
index 9325fed321..153db70970 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
@@ -27,8 +27,8 @@
#include "velox/expression/SignatureBinder.h"
namespace gluten {
-
namespace {
+
const char* extractFileName(const char* file) {
return strrchr(file, '/') ? strrchr(file, '/') + 1 : file;
}
diff --git a/cpp/velox/substrait/TypeUtils.h b/cpp/velox/substrait/TypeUtils.h
index b2aaf72578..20dd33031d 100644
--- a/cpp/velox/substrait/TypeUtils.h
+++ b/cpp/velox/substrait/TypeUtils.h
@@ -22,6 +22,7 @@
using namespace facebook::velox;
namespace gluten {
+
#ifndef RANGETRAITS_H
#define RANGETRAITS_H
diff --git a/cpp/velox/substrait/VariantToVectorConverter.cc
b/cpp/velox/substrait/VariantToVectorConverter.cc
index f8c9c11f0f..f33633b91e 100644
--- a/cpp/velox/substrait/VariantToVectorConverter.cc
+++ b/cpp/velox/substrait/VariantToVectorConverter.cc
@@ -67,4 +67,5 @@ VectorPtr setVectorFromVariantsByKind<TypeKind::VARCHAR>(
VectorPtr setVectorFromVariants(const TypePtr& type, const
std::vector<variant>& values, memory::MemoryPool* pool) {
return VELOX_DYNAMIC_SCALAR_TYPE_DISPATCH(setVectorFromVariantsByKind,
type->kind(), values, type, pool);
}
+
} // namespace gluten
diff --git a/cpp/velox/substrait/VeloxToSubstraitPlan.cc
b/cpp/velox/substrait/VeloxToSubstraitPlan.cc
index 19259f81f6..44fbb01b39 100644
--- a/cpp/velox/substrait/VeloxToSubstraitPlan.cc
+++ b/cpp/velox/substrait/VeloxToSubstraitPlan.cc
@@ -20,7 +20,6 @@
#include "utils/Exception.h"
namespace gluten {
-
namespace {
struct AggregateCompanion {
diff --git a/cpp/velox/tests/BufferOutputStreamTest.cc
b/cpp/velox/tests/BufferOutputStreamTest.cc
index 0e16f8c877..b9ea62fd7b 100644
--- a/cpp/velox/tests/BufferOutputStreamTest.cc
+++ b/cpp/velox/tests/BufferOutputStreamTest.cc
@@ -24,6 +24,7 @@
using namespace facebook::velox;
namespace gluten {
+
class BufferOutputStreamTest : public ::testing::Test, public
test::VectorTestBase {
protected:
// Velox requires the mem manager to be instanced.
@@ -69,4 +70,5 @@ TEST_F(BufferOutputStreamTest, outputStream) {
// We expect dropping the stream frees the backing memory.
EXPECT_EQ(0, veloxPool_->usedBytes());
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/FunctionTest.cc b/cpp/velox/tests/FunctionTest.cc
index b55b64ba98..c149b2db38 100644
--- a/cpp/velox/tests/FunctionTest.cc
+++ b/cpp/velox/tests/FunctionTest.cc
@@ -34,6 +34,7 @@ using namespace facebook::velox;
using namespace facebook::velox::test;
namespace gluten {
+
class FunctionTest : public ::testing::Test, public test::VectorTestBase {
protected:
static void SetUpTestCase() {
@@ -212,4 +213,5 @@ TEST_F(FunctionTest, sigToTypes) {
ASSERT_TRUE(types[0]->childAt(2)->isDecimal());
ASSERT_EQ(types[0]->childAt(3)->kind(), TypeKind::BOOLEAN);
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/MemoryManagerTest.cc
b/cpp/velox/tests/MemoryManagerTest.cc
index 8794f9d3af..74bf2c58ef 100644
--- a/cpp/velox/tests/MemoryManagerTest.cc
+++ b/cpp/velox/tests/MemoryManagerTest.cc
@@ -21,6 +21,7 @@
#include "velox/common/base/tests/GTestUtils.h"
namespace gluten {
+
using namespace facebook::velox;
class MockAllocationListener : public gluten::AllocationListener {
@@ -398,4 +399,5 @@ TEST_F(MultiMemoryManagerTest, spill) {
ASSERT_EQ(tmm.currentBytes(), 0);
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/SparkFunctionTest.cc
b/cpp/velox/tests/SparkFunctionTest.cc
index 2105b155e3..ae5e7c48d8 100644
--- a/cpp/velox/tests/SparkFunctionTest.cc
+++ b/cpp/velox/tests/SparkFunctionTest.cc
@@ -22,6 +22,7 @@
using namespace facebook::velox::functions::sparksql::test;
using namespace facebook::velox;
+
class SparkFunctionTest : public SparkFunctionBaseTest {
public:
SparkFunctionTest() {
diff --git a/cpp/velox/tests/Substrait2VeloxPlanConversionTest.cc
b/cpp/velox/tests/Substrait2VeloxPlanConversionTest.cc
index 3193f53bfb..cccc619a86 100644
--- a/cpp/velox/tests/Substrait2VeloxPlanConversionTest.cc
+++ b/cpp/velox/tests/Substrait2VeloxPlanConversionTest.cc
@@ -35,6 +35,7 @@ using namespace facebook::velox::connector::hive;
using namespace facebook::velox::exec;
namespace gluten {
+
class Substrait2VeloxPlanConversionTest : public
exec::test::HiveConnectorTestBase {
protected:
std::vector<std::shared_ptr<facebook::velox::connector::ConnectorSplit>>
makeSplits(
@@ -275,4 +276,5 @@ TEST_F(Substrait2VeloxPlanConversionTest, filterUpper) {
"-- Project[1][expressions: ] -> \n -- TableScan[0][table: hive_table,
remaining filter: (and(isnotnull(\"key\"),lessthan(\"key\",3)))] ->
n0_0:INTEGER\n",
planNode->toString(true, true));
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/Substrait2VeloxPlanValidatorTest.cc
b/cpp/velox/tests/Substrait2VeloxPlanValidatorTest.cc
index 0a957f038f..3f90c865df 100644
--- a/cpp/velox/tests/Substrait2VeloxPlanValidatorTest.cc
+++ b/cpp/velox/tests/Substrait2VeloxPlanValidatorTest.cc
@@ -35,6 +35,7 @@ using namespace facebook::velox::connector::hive;
using namespace facebook::velox::exec;
namespace gluten {
+
class Substrait2VeloxPlanValidatorTest : public
exec::test::HiveConnectorTestBase {
protected:
bool validatePlan(std::string file) {
@@ -64,4 +65,5 @@ TEST_F(Substrait2VeloxPlanValidatorTest, group) {
ASSERT_FALSE(validatePlan(substraitPlan));
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/Substrait2VeloxValuesNodeConversionTest.cc
b/cpp/velox/tests/Substrait2VeloxValuesNodeConversionTest.cc
index 75099db959..b5a131790a 100644
--- a/cpp/velox/tests/Substrait2VeloxValuesNodeConversionTest.cc
+++ b/cpp/velox/tests/Substrait2VeloxValuesNodeConversionTest.cc
@@ -32,6 +32,7 @@ using namespace facebook::velox::exec;
using namespace facebook::velox::exec::test;
namespace gluten {
+
class Substrait2VeloxValuesNodeConversionTest : public OperatorTestBase {};
// SELECT * FROM tmp
@@ -57,4 +58,5 @@ TEST_F(Substrait2VeloxValuesNodeConversionTest, valuesNode) {
createDuckDbTable({expectedData});
assertQuery(veloxPlan, "SELECT * FROM tmp");
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/VeloxBatchResizerTest.cc
b/cpp/velox/tests/VeloxBatchResizerTest.cc
index aecd52f927..fc741e0154 100644
--- a/cpp/velox/tests/VeloxBatchResizerTest.cc
+++ b/cpp/velox/tests/VeloxBatchResizerTest.cc
@@ -82,4 +82,5 @@ TEST_F(VeloxBatchResizerTest, sanity) {
checkResize(100, 200, {5, 900, 700}, {5, 200, 200, 200, 200, 100, 200, 200,
200, 100});
ASSERT_ANY_THROW(checkResize(0, 0, {}, {}));
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/VeloxColumnarBatchSerializerTest.cc
b/cpp/velox/tests/VeloxColumnarBatchSerializerTest.cc
index c00ab6a148..333bb047f9 100644
--- a/cpp/velox/tests/VeloxColumnarBatchSerializerTest.cc
+++ b/cpp/velox/tests/VeloxColumnarBatchSerializerTest.cc
@@ -29,6 +29,7 @@
using namespace facebook::velox;
namespace gluten {
+
class VeloxColumnarBatchSerializerTest : public ::testing::Test, public
test::VectorTestBase {
protected:
static void SetUpTestCase() {
diff --git a/cpp/velox/tests/VeloxColumnarBatchTest.cc
b/cpp/velox/tests/VeloxColumnarBatchTest.cc
index ba66afb40f..3ad9757515 100644
--- a/cpp/velox/tests/VeloxColumnarBatchTest.cc
+++ b/cpp/velox/tests/VeloxColumnarBatchTest.cc
@@ -61,4 +61,5 @@ TEST_F(VeloxColumnarBatchTest, flattenTruncatedVector) {
auto batchOfMap = std::make_shared<VeloxColumnarBatch>(inputOfMap);
ASSERT_NO_THROW(batchOfMap->getFlattenedRowVector());
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/VeloxColumnarToRowTest.cc
b/cpp/velox/tests/VeloxColumnarToRowTest.cc
index 3adacdda9d..85bdf5b9ec 100644
--- a/cpp/velox/tests/VeloxColumnarToRowTest.cc
+++ b/cpp/velox/tests/VeloxColumnarToRowTest.cc
@@ -27,6 +27,7 @@ using namespace facebook;
using namespace facebook::velox;
namespace gluten {
+
class VeloxColumnarToRowTest : public ::testing::Test, public
test::VectorTestBase {
protected:
static void SetUpTestCase() {
@@ -92,4 +93,5 @@ TEST_F(VeloxColumnarToRowTest, Buffer_int64_int64_with_null) {
};
testRowBufferAddr(vector, expectArr, sizeof(expectArr));
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/VeloxRowToColumnarTest.cc
b/cpp/velox/tests/VeloxRowToColumnarTest.cc
index 0d11dd4acb..937b8b80b6 100644
--- a/cpp/velox/tests/VeloxRowToColumnarTest.cc
+++ b/cpp/velox/tests/VeloxRowToColumnarTest.cc
@@ -26,6 +26,7 @@ using namespace facebook;
using namespace facebook::velox;
namespace gluten {
+
class VeloxRowToColumnarTest : public ::testing::Test, public
test::VectorTestBase {
protected:
static void SetUpTestCase() {
@@ -141,4 +142,5 @@ TEST_F(VeloxRowToColumnarTest, timestamp) {
});
testRowVectorEqual(vector);
}
+
} // namespace gluten
diff --git a/cpp/velox/tests/VeloxShuffleWriterTest.cc
b/cpp/velox/tests/VeloxShuffleWriterTest.cc
index ddcc30ff1c..e760a469b1 100644
--- a/cpp/velox/tests/VeloxShuffleWriterTest.cc
+++ b/cpp/velox/tests/VeloxShuffleWriterTest.cc
@@ -35,7 +35,6 @@ using namespace arrow;
using namespace arrow::ipc;
namespace gluten {
-
namespace {
facebook::velox::RowVectorPtr takeRows(
@@ -728,4 +727,5 @@ INSTANTIATE_TEST_SUITE_P(
VeloxShuffleWriteParam,
RangePartitioningShuffleWriter,
::testing::ValuesIn(kShuffleWriteTestParams));
+
} // namespace gluten
diff --git a/cpp/velox/tests/VeloxSubstraitRoundTripTest.cc
b/cpp/velox/tests/VeloxSubstraitRoundTripTest.cc
index b675bf4a28..a1cd59c6c0 100644
--- a/cpp/velox/tests/VeloxSubstraitRoundTripTest.cc
+++ b/cpp/velox/tests/VeloxSubstraitRoundTripTest.cc
@@ -37,6 +37,7 @@ using namespace facebook::velox::test;
using namespace facebook::velox::exec::test;
namespace gluten {
+
class VeloxSubstraitRoundTripTest : public OperatorTestBase {
protected:
/// Makes a vector of INTEGER type with 'size' RowVectorPtr.
diff --git a/cpp/velox/tests/VeloxToSubstraitTypeTest.cc
b/cpp/velox/tests/VeloxToSubstraitTypeTest.cc
index bc9e9df05c..ea8ff790b2 100644
--- a/cpp/velox/tests/VeloxToSubstraitTypeTest.cc
+++ b/cpp/velox/tests/VeloxToSubstraitTypeTest.cc
@@ -61,4 +61,5 @@ TEST_F(VeloxToSubstraitTypeTest, basic) {
testTypeConversion(ROW({"a", "b", "c"}, {BIGINT(), ROW({"x", "y"},
{BOOLEAN(), VARCHAR()}), REAL()}));
testTypeConversion(ROW({}, {}));
}
+
} // namespace gluten
diff --git a/cpp/velox/udf/Udaf.h b/cpp/velox/udf/Udaf.h
index 4555bdfdf8..f421ecbc31 100644
--- a/cpp/velox/udf/Udaf.h
+++ b/cpp/velox/udf/Udaf.h
@@ -39,4 +39,5 @@ struct UdafEntry {
#define GLUTEN_REGISTER_UDAF registerUdf
#define DEFINE_REGISTER_UDAF extern "C" void GLUTEN_REGISTER_UDAF()
+
} // namespace gluten
diff --git a/cpp/velox/udf/UdfLoader.h b/cpp/velox/udf/UdfLoader.h
index 51264e67cc..8a28c2a351 100644
--- a/cpp/velox/udf/UdfLoader.h
+++ b/cpp/velox/udf/UdfLoader.h
@@ -94,4 +94,5 @@ class UdfLoader {
std::unordered_set<std::shared_ptr<UdfSignature>> signatures_;
std::unordered_set<std::string> names_;
};
+
} // namespace gluten
diff --git a/cpp/velox/udf/examples/MyUDAF.cc b/cpp/velox/udf/examples/MyUDAF.cc
index 516404b55c..816880d2e7 100644
--- a/cpp/velox/udf/examples/MyUDAF.cc
+++ b/cpp/velox/udf/examples/MyUDAF.cc
@@ -173,6 +173,7 @@ class MyAvgRegisterer final : public gluten::UdafRegisterer
{
const char* myAvgIntermediateType_ = "struct<a:double,b:bigint>";
};
+
} // namespace myavg
std::vector<std::shared_ptr<gluten::UdafRegisterer>>& globalRegisters() {
diff --git a/cpp/velox/udf/examples/MyUDF.cc b/cpp/velox/udf/examples/MyUDF.cc
index 783699614f..260629fdf9 100644
--- a/cpp/velox/udf/examples/MyUDF.cc
+++ b/cpp/velox/udf/examples/MyUDF.cc
@@ -33,6 +33,7 @@ static const char* kDate = "date";
static const char* kVarChar = "varchar";
namespace hivestringstring {
+
template <typename T>
struct HiveStringStringFunction {
VELOX_DEFINE_FUNCTION_TYPES(T);
@@ -67,6 +68,7 @@ class HiveStringStringRegisterer final : public
gluten::UdfRegisterer {
const std::string name_ =
"org.apache.spark.sql.hive.execution.UDFStringString";
const char* arg_[2] = {kVarChar, kVarChar};
};
+
} // namespace hivestringstring
std::vector<std::shared_ptr<gluten::UdfRegisterer>>& globalRegisters() {
diff --git a/cpp/velox/utils/HdfsUtils.cc b/cpp/velox/utils/HdfsUtils.cc
index ec395f817c..f03ca9c17d 100644
--- a/cpp/velox/utils/HdfsUtils.cc
+++ b/cpp/velox/utils/HdfsUtils.cc
@@ -23,6 +23,7 @@
namespace gluten {
namespace {
+
struct Credential {
const std::string userName;
const std::string allTokens;
@@ -34,6 +35,7 @@ struct Credential {
return !(rhs == *this);
}
};
+
} // namespace
void updateHdfsTokens(const facebook::velox::config::ConfigBase* veloxCfg) {
@@ -63,4 +65,5 @@ void updateHdfsTokens(const
facebook::velox::config::ConfigBase* veloxCfg) {
hdfsSetTokenForDefaultUser(token.data());
activeCredential.emplace(newCredential);
}
+
} // namespace gluten
diff --git a/cpp/velox/utils/VeloxBatchResizer.cc
b/cpp/velox/utils/VeloxBatchResizer.cc
index 5642929946..851af9c83c 100644
--- a/cpp/velox/utils/VeloxBatchResizer.cc
+++ b/cpp/velox/utils/VeloxBatchResizer.cc
@@ -18,8 +18,8 @@
#include "VeloxBatchResizer.h"
namespace gluten {
-
namespace {
+
class SliceRowVector : public ColumnarBatchIterator {
public:
SliceRowVector(int32_t maxOutputBatchSize, facebook::velox::RowVectorPtr in)
@@ -115,4 +115,5 @@ std::shared_ptr<ColumnarBatch> VeloxBatchResizer::next() {
int64_t VeloxBatchResizer::spillFixedSize(int64_t size) {
return in_->spillFixedSize(size);
}
+
} // namespace gluten
diff --git a/cpp/velox/utils/VeloxBatchResizer.h
b/cpp/velox/utils/VeloxBatchResizer.h
index 522baf4982..d3d1539dd7 100644
--- a/cpp/velox/utils/VeloxBatchResizer.h
+++ b/cpp/velox/utils/VeloxBatchResizer.h
@@ -22,6 +22,7 @@
#include "velox/vector/ComplexVector.h"
namespace gluten {
+
class VeloxBatchResizer : public ColumnarBatchIterator {
public:
VeloxBatchResizer(
@@ -42,4 +43,5 @@ class VeloxBatchResizer : public ColumnarBatchIterator {
std::unique_ptr<ColumnarBatchIterator> next_ = nullptr;
};
+
} // namespace gluten
diff --git a/cpp/velox/utils/tests/MemoryPoolUtils.cc
b/cpp/velox/utils/tests/MemoryPoolUtils.cc
index 5a0ae03b14..2d4e19511a 100644
--- a/cpp/velox/utils/tests/MemoryPoolUtils.cc
+++ b/cpp/velox/utils/tests/MemoryPoolUtils.cc
@@ -152,4 +152,5 @@ arrow::Status SelfEvictedMemoryPool::ensureCapacity(int64_t
size) {
}
return arrow::Status::OK();
}
-} // namespace gluten
\ No newline at end of file
+
+} // namespace gluten
diff --git a/cpp/velox/utils/tests/MemoryPoolUtils.h
b/cpp/velox/utils/tests/MemoryPoolUtils.h
index 68e2790084..5fdf880be6 100644
--- a/cpp/velox/utils/tests/MemoryPoolUtils.h
+++ b/cpp/velox/utils/tests/MemoryPoolUtils.h
@@ -24,9 +24,7 @@
namespace gluten {
-/**
- * arrow::MemoryPool instance with limited capacity, used by tests and
benchmarks
- */
+// arrow::MemoryPool instance with limited capacity, used by tests and
benchmarks.
class LimitedMemoryPool final : public arrow::MemoryPool {
public:
explicit LimitedMemoryPool() :
capacity_(std::numeric_limits<int64_t>::max()) {}
@@ -54,9 +52,7 @@ class LimitedMemoryPool final : public arrow::MemoryPool {
arrow::internal::MemoryPoolStats stats_;
};
-/**
- * arrow::MemoryPool instance with limited capacity and can be evictable on
OOM, used by tests and benchmarks
- */
+// arrow::MemoryPool instance with limited capacity and can be evictable on
OOM, used by tests and benchmarks.
class SelfEvictedMemoryPool : public arrow::MemoryPool {
public:
explicit SelfEvictedMemoryPool(arrow::MemoryPool* pool, bool failIfOOM =
true) : pool_(pool), failIfOOM_(failIfOOM) {}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]