kou commented on pull request #8782:
URL: https://github.com/apache/arrow/pull/8782#issuecomment-736217882
It seems that the template type name `T` is conflicted with Visual C++.
Could you try this patch?
```diff
diff --git a/cpp/src/parquet/statistics_test.cc
b/cpp/src/parquet/statistics_test.cc
index 0828f36b3..77e77e0eb 100644
--- a/cpp/src/parquet/statistics_test.cc
+++ b/cpp/src/parquet/statistics_test.cc
@@ -609,7 +609,7 @@ static const int NUM_VALUES = 10;
template <typename TestType>
class TestStatisticsSortOrder : public ::testing::Test {
public:
- typedef typename TestType::c_type T;
+ using c_type = typename TestType::c_type;
void AddNodes(std::string name) {
fields_.push_back(schema::PrimitiveNode::Make(
@@ -670,7 +670,7 @@ class TestStatisticsSortOrder : public ::testing::Test {
}
protected:
- std::vector<T> values_;
+ std::vector<c_type> values_;
std::vector<uint8_t> values_buf_;
std::vector<schema::NodePtr> fields_;
std::shared_ptr<schema::GroupNode> schema_;
@@ -700,13 +700,13 @@ void TestStatisticsSortOrder<Int32Type>::SetValues() {
// Write UINT32 min/max values
stats_[0]
- .set_min(std::string(reinterpret_cast<const char*>(&values_[5]),
sizeof(T)))
- .set_max(std::string(reinterpret_cast<const char*>(&values_[4]),
sizeof(T)));
+ .set_min(std::string(reinterpret_cast<const char*>(&values_[5]),
sizeof(c_type)))
+ .set_max(std::string(reinterpret_cast<const char*>(&values_[4]),
sizeof(c_type)));
// Write INT32 min/max values
stats_[1]
- .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(T)))
- .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(T)));
+ .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(c_type)))
+ .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(c_type)));
}
// TYPE::INT64
@@ -728,13 +728,13 @@ void TestStatisticsSortOrder<Int64Type>::SetValues() {
// Write UINT64 min/max values
stats_[0]
- .set_min(std::string(reinterpret_cast<const char*>(&values_[5]),
sizeof(T)))
- .set_max(std::string(reinterpret_cast<const char*>(&values_[4]),
sizeof(T)));
+ .set_min(std::string(reinterpret_cast<const char*>(&values_[5]),
sizeof(c_type)))
+ .set_max(std::string(reinterpret_cast<const char*>(&values_[4]),
sizeof(c_type)));
// Write INT64 min/max values
stats_[1]
- .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(T)))
- .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(T)));
+ .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(c_type)))
+ .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(c_type)));
}
// TYPE::FLOAT
@@ -747,8 +747,8 @@ void TestStatisticsSortOrder<FloatType>::SetValues() {
// Write Float min/max values
stats_[0]
- .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(T)))
- .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(T)));
+ .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(c_type)))
+ .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(c_type)));
}
// TYPE::DOUBLE
@@ -761,8 +761,8 @@ void TestStatisticsSortOrder<DoubleType>::SetValues() {
// Write Double min/max values
stats_[0]
- .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(T)))
- .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(T)));
+ .set_min(std::string(reinterpret_cast<const char*>(&values_[0]),
sizeof(c_type)))
+ .set_max(std::string(reinterpret_cast<const char*>(&values_[9]),
sizeof(c_type)));
}
// TYPE::ByteArray
```
Here is a patch to fix CMake lint failure:
```diff
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index bdf15e4bc..46872fba3 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1603,7 +1603,7 @@ macro(build_gtest)
set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/googletest_ep-prefix")
set(GTEST_INCLUDE_DIR "${GTEST_PREFIX}/include")
-set(_GTEST_LIBRARY_DIR "${GTEST_PREFIX}/lib")
+ set(_GTEST_LIBRARY_DIR "${GTEST_PREFIX}/lib")
if(MSVC)
set(_GTEST_IMPORTED_TYPE IMPORTED_IMPLIB)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]