paleolimbot commented on code in PR #45459:
URL: https://github.com/apache/arrow/pull/45459#discussion_r1975905554


##########
cpp/src/parquet/test_util.h:
##########
@@ -830,5 +833,124 @@ inline void GenerateData<FLBA>(int num_values, FLBA* out, 
std::vector<uint8_t>*
   random_fixed_byte_array(num_values, 0, heap->data(), 
kGenerateDataFLBALength, out);
 }
 
+// ----------------------------------------------------------------------
+// Test utility functions for geometry
+
+#if defined(ARROW_LITTLE_ENDIAN)
+static constexpr uint8_t kWkbNativeEndianness = 0x01;
+#else
+static constexpr uint8_t kWkbNativeEndianness = 0x00;
+#endif
+
+static uint32_t GeometryTypeToWKB(geometry::GeometryType geometry_type, bool 
has_z,
+                                  bool has_m) {
+  auto wkb_geom_type = static_cast<uint32_t>(geometry_type);
+
+  if (has_z) {
+    wkb_geom_type += 1000;
+  }
+
+  if (has_m) {
+    wkb_geom_type += 2000;
+  }
+
+  return wkb_geom_type;
+}
+
+static inline std::string MakeWKBPoint(const double* xyzm, bool has_z, bool 
has_m) {

Review Comment:
   I made a few changes here to make this slightly nicer (`std::vector` lets 
you write `MakeWKBPoint({1, 2}, ...`). I'm happy to update anything about this 
if there's something else that would make it better!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to