You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@graphar.apache.org by "SYaoJun (via GitHub)" <gi...@apache.org> on 2026/02/13 16:52:06 UTC

[PR] fix(C++): remove redundant `inline` keyword and avoid mislead developer. [incubator-graphar]

SYaoJun opened a new pull request, #858:
URL: https://github.com/apache/incubator-graphar/pull/858

   <!--
   Thanks for contributing to GraphAr.
   If this is your first pull request you can find detailed information on [CONTRIBUTING.md](https://github.com/apache/graphar/blob/main/CONTRIBUTING.md)
   
   The Apache GraphAr (incubating) community has restrictions on the naming of pr title. You can find instructions in
   [CONTRIBUTING.md](https://github.com/apache/graphar/blob/main/CONTRIBUTING.md#title) too.
   -->
   
   ### Reason for this PR
   <!-- 
   Why are you proposing this change? If this is already tracked in an issue, please link to the issue here.
   Explaining clearly why this change is beneficial is important for the reviewers to understand the context.
   -->
   
   
   ### What changes are included in this PR?
   <!-- 
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ### Are these changes tested?
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ### Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
   -->
   <!-- **BREAKING CHANGE: <description>** -->
   
   <!--
   Please uncomment the line below (and provide explanation) if the changes fix either
   (a) a security vulnerability,
   (b) a bug that caused incorrect or invalid data to be produced, or
   (c) a bug that causes a crash (even when the API contract is upheld). 
   We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
   -->
   <!-- **Critical Fix: <description>** -->
   


-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org


Re: [PR] fix(C++): remove redundant `inline` keyword [incubator-graphar]

Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on PR #858:
URL: https://github.com/apache/incubator-graphar/pull/858#issuecomment-3956673574

   For the sake of simplicity and clarity, I’ve fixed the typos in another PR #875.


-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org


Re: [PR] fix(C++): remove redundant `inline` keyword [incubator-graphar]

Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun closed pull request #858: fix(C++): remove redundant `inline` keyword
URL: https://github.com/apache/incubator-graphar/pull/858


-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org


Re: [PR] fix(C++): remove redundant `inline` keyword and fix typos [incubator-graphar]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #858:
URL: https://github.com/apache/incubator-graphar/pull/858#discussion_r2844113640


##########
cpp/src/graphar/expression.h:
##########
@@ -307,51 +307,51 @@ template <typename T,
               std::is_same_v<T, const char*> ||
               std::is_same_v<T, const char* const>,
           typename = std::enable_if_t<IsScalar>>
-[[nodiscard]] static inline std::shared_ptr<Expression> _Literal(T value) {
+[[nodiscard]] static std::shared_ptr<Expression> _Literal(T value) {
   return std::make_shared<ExpressionLiteral<T>>(value);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _Not(
+[[nodiscard]] static std::shared_ptr<Expression> _Not(
     std::shared_ptr<Expression> expr) {
   return std::make_shared<ExpressionNot>(expr);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _Equal(
+[[nodiscard]] static std::shared_ptr<Expression> _Equal(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionEqual>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _NotEqual(
+[[nodiscard]] static std::shared_ptr<Expression> _NotEqual(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionNotEqual>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _GreaterThan(
+[[nodiscard]] static std::shared_ptr<Expression> _GreaterThan(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionGreaterThan>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _GreaterEqual(
+[[nodiscard]] static std::shared_ptr<Expression> _GreaterEqual(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionGreaterEqual>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _LessThan(
+[[nodiscard]] static std::shared_ptr<Expression> _LessThan(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionLessThan>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _LessEqual(
+[[nodiscard]] static std::shared_ptr<Expression> _LessEqual(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionLessEqual>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _And(
+[[nodiscard]] static std::shared_ptr<Expression> _And(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionAnd>(lhs, rhs);
 }
 
-[[nodiscard]] static inline std::shared_ptr<Expression> _Or(
+[[nodiscard]] static std::shared_ptr<Expression> _Or(
     std::shared_ptr<Expression> lhs, std::shared_ptr<Expression> rhs) {
   return std::make_shared<ExpressionOr>(lhs, rhs);
 }

Review Comment:
   The removal of `inline` from these static namespace-level helper functions (lines 292-357) doesn't align with the PR description's rationale. The cited C++ standard section (class.mfct#1) only applies to member functions defined within class declarations. These are static functions at namespace scope in a header file, where removing inline causes each translation unit to get its own copy of the functions. Consider keeping `inline` for these functions.



##########
cpp/CMakeLists.txt:
##########
@@ -614,7 +614,11 @@ if (BUILD_BENCHMARKS)
         add_executable(${target} ${add_test_SRCS})
         target_compile_features(${target} PRIVATE cxx_std_17)
         target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/thirdparty)
-        target_link_libraries(${target} PRIVATE benchmark::benchmark_main graphar ${CMAKE_DL_LIBS})
+        if(APPLE)
+            target_link_libraries(${target} PRIVATE benchmark::benchmark_main graphar Arrow::arrow_shared Parquet::parquet_shared ${CMAKE_DL_LIBS})
+        else()
+            target_link_libraries(${target} PRIVATE benchmark::benchmark_main graphar parquet arrow ${CMAKE_DL_LIBS})
+        endif()

Review Comment:
   The changes to the benchmark linking configuration don't align with the stated PR purpose of "removing redundant inline keywords and fixing typos." This appears to be an unrelated build system change that adjusts how Arrow and Parquet libraries are linked for benchmarks on different platforms (using namespaced targets on Apple vs. plain library names on other platforms). This change should either be documented in the PR description or moved to a separate PR focused on build system improvements.



##########
cpp/src/graphar/high-level/edges_builder.h:
##########
@@ -385,6 +384,9 @@ class EdgesBuilder {
    * @return The vertex chunk index of the edge.
    */
   IdType getVertexChunkIndex(const Edge& e) {
+    if (vertex_chunk_size_ == 0) {
+      return 0;
+    }

Review Comment:
   This division by zero check is a bug fix that doesn't align with the stated PR purpose of "removing redundant inline keywords and fixing typos." While this is a good defensive programming practice to prevent potential crashes, it should be documented in the PR description or moved to a separate bug fix PR. The fix prevents division by zero when vertex_chunk_size_ is 0, but it's unclear if returning 0 is the correct behavior in this case or if it should be an error.



##########
cpp/src/graphar/label.h:
##########
@@ -48,7 +48,7 @@ enum QUERY_TYPE {
 };
 
 /// Set bit
-static inline void SetBitmap(uint64_t* bitmap, const int index) {
+static void SetBitmap(uint64_t* bitmap, const int index) {

Review Comment:
   The removal of `inline` from this static namespace-level function doesn't align with the PR description's rationale. The cited C++ standard section (class.mfct#1) only applies to member functions defined within class declarations. This is a static function at namespace scope in a header file, where removing inline causes each translation unit to get its own copy of the function. Consider keeping `inline` for this function.
   ```suggestion
   static inline void SetBitmap(uint64_t* bitmap, const int index) {
   ```



-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org


Re: [PR] fix(C++): remove redundant `inline` keyword and fix typos [incubator-graphar]

Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on PR #858:
URL: https://github.com/apache/incubator-graphar/pull/858#issuecomment-3902809752

   I found a CMake bug in the benchmark after updating the code. I’ll fix it as part of this update.
   
   ```shell
   [100%] Linking CXX executable graph_info_benchmark
   /usr/bin/ld: CMakeFiles/graph_info_benchmark.dir/benchmarks/graph_info_benchmark.cc.o: undefined reference to symbol '_ZN7parquet5arrow8OpenFileESt10shared_ptrIN5arrow2io16RandomAccessFileEEPNS2_10MemoryPoolEPSt10unique_ptrINS0_10FileReaderESt14default_deleteIS9_EE'
   /usr/bin/ld: /lib/x86_64-linux-gnu/libparquet.so.1700: error adding symbols: DSO missing from command line
   collect2: error: ld returned 1 exit status
   make[2]: *** [CMakeFiles/graph_info_benchmark.dir/build.make:103: graph_info_benchmark] Error 1
   make[1]: *** [CMakeFiles/Makefile2:2024: CMakeFiles/graph_info_benchmark.dir/all] Error 2
   make: *** [Makefile:146: all] Error 2
   ``` `


-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org


Re: [PR] fix(C++): remove redundant `inline` keyword and fix typos [incubator-graphar]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #858:
URL: https://github.com/apache/incubator-graphar/pull/858#issuecomment-3900196423

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-graphar/pull/858?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 80.08%. Comparing base ([`02bd3fe`](https://app.codecov.io/gh/apache/incubator-graphar/commit/02bd3fe10a72436f21cf1da889172159273ae224?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6c5682e`](https://app.codecov.io/gh/apache/incubator-graphar/commit/6c5682e58b6106c80855fb2277aab44b479d654f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main     #858      +/-   ##
   ============================================
   - Coverage     80.21%   80.08%   -0.14%     
     Complexity      615      615              
   ============================================
     Files            93       93              
     Lines         10257    10182      -75     
     Branches       1049     1043       -6     
   ============================================
   - Hits           8228     8154      -74     
   + Misses         1789     1788       -1     
     Partials        240      240              
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-graphar/pull/858?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org


Re: [PR] fix(C++): remove redundant `inline` keyword and fix typos [incubator-graphar]

Posted by "yangxk1 (via GitHub)" <gi...@apache.org>.
yangxk1 commented on PR #858:
URL: https://github.com/apache/incubator-graphar/pull/858#issuecomment-3956362218

   Hi @SYaoJun , the CI failed. It seems to be caused by inline


-- 
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: commits-unsubscribe@graphar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org