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 f919fab76 ORC-1706: [C++] Fix build break w/ 
BUILD_CPP_ENABLE_METRICS=ON
f919fab76 is described below

commit f919fab762f189cacb96f19f435da70a6496da82
Author: ffacs <ffacs@[email protected]>
AuthorDate: Sat Apr 27 22:15:03 2024 +0800

    ORC-1706: [C++] Fix build break w/ BUILD_CPP_ENABLE_METRICS=ON
    
    ### What changes were proposed in this pull request?
    1. Fix build break w/ BUILD_CPP_ENABLE_METRICS=ON
    2. Add -DBUILD_CPP_ENABLE_METRICS=ON on format check actions.
    3. Fix a typo on README file name.
    
    ### Why are the changes needed?
    C++ build breaks when the option BUILD_CPP_ENABLE_METRICS is switched on.
    
    ### How was this patch tested?
    UT passed.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    NO
    
    Closes #1915 from ffacs/ORC-1706.
    
    Authored-by: ffacs <ffacs@[email protected]>
    Signed-off-by: Gang Wu <[email protected]>
---
 .github/workflows/build_and_test.yml      | 2 +-
 c++/build-support/{REAMD.md => README.md} | 0
 c++/src/OrcFile.cc                        | 2 +-
 c++/src/Reader.cc                         | 2 +-
 c++/src/Writer.cc                         | 4 ++--
 c++/src/io/OutputStream.cc                | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build_and_test.yml 
b/.github/workflows/build_and_test.yml
index 533ec62ce..30d374e75 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -177,7 +177,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          cmake .. -DBUILD_JAVA=OFF -DCMAKE_CXX_COMPILER=clang++ 
-DCMAKE_C_COMPILER=clang -DSTOP_BUILD_ON_WARNING=OFF 
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
+          cmake .. -DBUILD_JAVA=OFF -DCMAKE_CXX_COMPILER=clang++ 
-DCMAKE_C_COMPILER=clang -DSTOP_BUILD_ON_WARNING=OFF 
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DBUILD_CPP_ENABLE_METRICS=1
           make
       - name: Check clang-tidy
         run: cd build && make check-clang-tidy
diff --git a/c++/build-support/REAMD.md b/c++/build-support/README.md
similarity index 100%
rename from c++/build-support/REAMD.md
rename to c++/build-support/README.md
diff --git a/c++/src/OrcFile.cc b/c++/src/OrcFile.cc
index 8899299d3..be8672432 100644
--- a/c++/src/OrcFile.cc
+++ b/c++/src/OrcFile.cc
@@ -79,7 +79,7 @@ namespace orc {
     }
 
     void read(void* buf, uint64_t length, uint64_t offset) override {
-      SCOPED_STOPWATCH(metrics, IOBlockingLatencyUs, IOCount);
+      SCOPED_STOPWATCH(metrics_, IOBlockingLatencyUs, IOCount);
       if (!buf) {
         throw ParseError("Buffer is null");
       }
diff --git a/c++/src/Reader.cc b/c++/src/Reader.cc
index 8a43818a5..2966c2c2e 100644
--- a/c++/src/Reader.cc
+++ b/c++/src/Reader.cc
@@ -1117,7 +1117,7 @@ namespace orc {
   }
 
   bool RowReaderImpl::next(ColumnVectorBatch& data) {
-    SCOPED_STOPWATCH(contents->readerMetrics, ReaderInclusiveLatencyUs, 
ReaderCall);
+    SCOPED_STOPWATCH(contents_->readerMetrics, ReaderInclusiveLatencyUs, 
ReaderCall);
     if (currentStripe_ >= lastStripe_) {
       data.numElements = 0;
       markEndOfFile();
diff --git a/c++/src/Writer.cc b/c++/src/Writer.cc
index fceac7c2f..0d672549c 100644
--- a/c++/src/Writer.cc
+++ b/c++/src/Writer.cc
@@ -437,7 +437,7 @@ namespace orc {
     // Write file header
     const static size_t magicIdLength = strlen(WriterImpl::magicId);
     {
-      SCOPED_STOPWATCH(options.getWriterMetrics(), IOBlockingLatencyUs, 
IOCount);
+      SCOPED_STOPWATCH(options_.getWriterMetrics(), IOBlockingLatencyUs, 
IOCount);
       outStream_->write(WriterImpl::magicId, magicIdLength);
     }
     currentOffset_ += magicIdLength;
@@ -585,7 +585,7 @@ namespace orc {
       throw std::logic_error("Failed to write post script.");
     }
     unsigned char psLength = static_cast<unsigned 
char>(bufferedStream_->flush());
-    SCOPED_STOPWATCH(options.getWriterMetrics(), IOBlockingLatencyUs, IOCount);
+    SCOPED_STOPWATCH(options_.getWriterMetrics(), IOBlockingLatencyUs, 
IOCount);
     outStream_->write(&psLength, sizeof(unsigned char));
   }
 
diff --git a/c++/src/io/OutputStream.cc b/c++/src/io/OutputStream.cc
index 6fc68e262..5f9563f30 100644
--- a/c++/src/io/OutputStream.cc
+++ b/c++/src/io/OutputStream.cc
@@ -87,7 +87,7 @@ namespace orc {
     uint64_t dataSize = dataBuffer_->size();
     // flush data buffer into outputStream
     if (dataSize > 0) {
-      SCOPED_STOPWATCH(metrics, IOBlockingLatencyUs, IOCount);
+      SCOPED_STOPWATCH(metrics_, IOBlockingLatencyUs, IOCount);
       dataBuffer_->writeTo(outputStream_, metrics_);
     }
     dataBuffer_->resize(0);

Reply via email to