You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2025/06/01 04:02:19 UTC

[PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

paleolimbot opened a new pull request, #46660:
URL: https://github.com/apache/arrow/pull/46660

   ### Rationale for this change
   
   Extension arrays exported with binary view/string view storage did not export the variadic sizes buffer which resulted in crashes when reimporting.
   
   ### What changes are included in this PR?
   
   The expression that controlled whether the variadic sizes buffer was written was updated.
   
   ### Are these changes tested?
   
   Yes, a test was added
   
   ### Are there any user-facing changes?
   
   No


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot merged PR #46660:
URL: https://github.com/apache/arrow/pull/46660


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on PR #46660:
URL: https://github.com/apache/arrow/pull/46660#issuecomment-2940256658

   @bkietz Any chance you have a minute to ensure I understood this correctly?


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #46660:
URL: https://github.com/apache/arrow/pull/46660#issuecomment-2926446313

   :warning: GitHub issue #46659 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #46660:
URL: https://github.com/apache/arrow/pull/46660#issuecomment-2943566616

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 610c201ff015acf6df201f3c48af67070b23713b.
   
   There were 70 benchmark results with an error:
   
   - Commit Run on `arm64-t4g-2xlarge-linux` at [2025-06-04 23:49:38Z](https://conbench.ursa.dev/compare/runs/22469c04cdfe4d6e963d7d7de694f3cc...a50f470096ef4cfd8b580db39b543499/)
     - [`tpch` (R) with engine=arrow, format=parquet, language=R, memory_map=False, query_id=TPCH-07, scale_factor=1](https://conbench.ursa.dev/benchmark-results/06840ee79e3c7dc58000ec42d1f2cf4d)
     - [`tpch` (R) with engine=arrow, format=native, language=R, memory_map=False, query_id=TPCH-09, scale_factor=1](https://conbench.ursa.dev/benchmark-results/06840ef2cb37778980000e4c16481ca9)
   - and 68 more (see the report linked below)
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/43532771034) has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.


-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

Posted by "bkietz (via GitHub)" <gi...@apache.org>.
bkietz commented on code in PR #46660:
URL: https://github.com/apache/arrow/pull/46660#discussion_r2127160724


##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -586,8 +586,12 @@ struct ArrayExporter {
       ++buffers_begin;
     }
 
+    Type::type storage_id =
+        data->type->id() == Type::EXTENSION
+            ? (checked_cast<const ExtensionType&>(*data->type).storage_type()->id())
+            : data->type->id();
     bool need_variadic_buffer_sizes =
-        data->type->id() == Type::BINARY_VIEW || data->type->id() == Type::STRING_VIEW;
+        storage_id == Type::BINARY_VIEW || storage_id == Type::STRING_VIEW;

Review Comment:
   There's a special accessor for this https://github.com/apache/arrow/blob/219d207f97152a5017cc61c0f925dc4387adc6f7/cpp/src/arrow/type.h#L184
   
   ```suggestion
           data->type->storage_id() == Type::BINARY_VIEW || storage_id == Type::STRING_VIEW;
   ```



##########
cpp/src/arrow/testing/extension_type.h:
##########
@@ -132,6 +132,23 @@ class ARROW_TESTING_EXPORT DictExtensionType : public ExtensionType {
   std::string Serialize() const override { return "dict-extension-serialized"; }
 };
 
+class ARROW_TESTING_EXPORT BinaryViewExtensionType : public ExtensionType {
+ public:
+  BinaryViewExtensionType() : ExtensionType(binary_view()) {}
+
+  std::string extension_name() const override { return "binary_view"; }
+
+  bool ExtensionEquals(const ExtensionType& other) const override;
+
+  std::shared_ptr<Array> MakeArray(std::shared_ptr<ArrayData> data) const override;
+
+  Result<std::shared_ptr<DataType>> Deserialize(
+      std::shared_ptr<DataType> storage_type,
+      const std::string& serialized) const override;
+
+  std::string Serialize() const override { return "binary_view_serializeds"; }

Review Comment:
   typo?
   
   ```suggestion
     std::string Serialize() const override { return "binary_view_serialized"; }
   ```



-- 
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: github-unsubscribe@arrow.apache.org

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


Re: [PR] GH-46659: [C++] Fix export of extension arrays with binary view/string view storage [arrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on PR #46660:
URL: https://github.com/apache/arrow/pull/46660#issuecomment-2941729030

   Thank you for the review!


-- 
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: github-unsubscribe@arrow.apache.org

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