You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Reranko05 (via GitHub)" <gi...@apache.org> on 2026/07/28 15:57:21 UTC
[PR] GH-50690: Migrate ObjectWriter users to JsonWriter [arrow]
Reranko05 opened a new pull request, #50691:
URL: https://github.com/apache/arrow/pull/50691
### Rationale for this change
This PR continues the simdjson migration by replacing the remaining `ObjectWriter` users with `JsonWriter`. With all usages migrated, the obsolete `ObjectWriter` implementation and its associated build configuration are removed.
### What changes are included in this PR?
* Replace `ObjectWriter` with `JsonWriter` in:
* `key_material.cc`
* `key_metadata.cc`
* `local_wrap_kms_client.cc`
* `file_system_key_material_store.cc`
* Remove the unused `ObjectWriter` implementation (`object_writer.cc` and `object_writer.h`).
* Remove `object_writer.h` from the installed headers.
* Update the Arrow build configuration to stop building `object_writer.cc`.
* Link Parquet against `simdjson::simdjson` since it now includes `json_writer_internal.h`.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
Closes: #50690
--
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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #50691:
URL: https://github.com/apache/arrow/pull/50691#issuecomment-5106606438
:warning: GitHub issue #50690 **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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou merged PR #50691:
URL: https://github.com/apache/arrow/pull/50691
--
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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "Reranko05 (via GitHub)" <gi...@apache.org>.
Reranko05 commented on code in PR #50691:
URL: https://github.com/apache/arrow/pull/50691#discussion_r3667552519
##########
cpp/src/parquet/encryption/key_material.cc:
##########
@@ -122,36 +122,57 @@ std::string KeyMaterial::SerializeToJson(
bool is_double_wrapped, const std::string& kek_id,
const std::string& encoded_wrapped_kek, const std::string& encoded_wrapped_dek,
bool is_internal_storage) {
- ObjectWriter json_writer;
- json_writer.SetString(kKeyMaterialTypeField, kKeyMaterialType1);
+ JsonWriter json_writer;
+
+ json_writer.StartObject();
+
+ json_writer.Key(kKeyMaterialTypeField);
+ json_writer.String(kKeyMaterialType1);
if (is_internal_storage) {
- // 1. for internal storage, key material and key metadata are the same.
- // adding the "internalStorage" field that belongs to KeyMetadata.
Review Comment:
Addressed.
--
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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #50691:
URL: https://github.com/apache/arrow/pull/50691#discussion_r3667197286
##########
cpp/src/parquet/encryption/key_material.cc:
##########
@@ -122,36 +122,57 @@ std::string KeyMaterial::SerializeToJson(
bool is_double_wrapped, const std::string& kek_id,
const std::string& encoded_wrapped_kek, const std::string& encoded_wrapped_dek,
bool is_internal_storage) {
- ObjectWriter json_writer;
- json_writer.SetString(kKeyMaterialTypeField, kKeyMaterialType1);
+ JsonWriter json_writer;
+
+ json_writer.StartObject();
+
+ json_writer.Key(kKeyMaterialTypeField);
+ json_writer.String(kKeyMaterialType1);
if (is_internal_storage) {
- // 1. for internal storage, key material and key metadata are the same.
- // adding the "internalStorage" field that belongs to KeyMetadata.
Review Comment:
Why not keep this comment?
##########
cpp/src/parquet/encryption/key_metadata.cc:
##########
@@ -73,15 +73,22 @@ KeyMetadata KeyMetadata::Parse(const std::string& key_metadata) {
// directly
std::string KeyMetadata::CreateSerializedForExternalMaterial(
const std::string& key_reference) {
- ObjectWriter json_writer;
+ JsonWriter json_writer;
- json_writer.SetString(KeyMaterial::kKeyMaterialTypeField,
- KeyMaterial::kKeyMaterialType1);
- json_writer.SetBool(kKeyMaterialInternalStorageField, false);
+ json_writer.StartObject();
- json_writer.SetString(kKeyReferenceField, key_reference);
+ json_writer.Key(KeyMaterial::kKeyMaterialTypeField);
+ json_writer.String(KeyMaterial::kKeyMaterialType1);
- return json_writer.Serialize();
+ json_writer.Key(kKeyMaterialInternalStorageField);
+ json_writer.Bool(false);
+
+ json_writer.Key(kKeyReferenceField);
+ json_writer.String(key_reference);
Review Comment:
Just a thought, but perhaps we can add helper methods to make such code less verbose?
```suggestion
json_writer.BoolField(kKeyMaterialInternalStorageField, false);
json_writer.StringField(kKeyReferenceField, key_reference);
```
##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -1042,7 +1042,7 @@ if(ARROW_JSON)
json/from_string.cc
json/json_writer_internal.cc
json/object_parser.cc
- json/object_writer.cc
+ json/json_writer.cc
Review Comment:
This is adding `json_writer.cc` but I don't see it in this PR?
--
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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "Reranko05 (via GitHub)" <gi...@apache.org>.
Reranko05 commented on code in PR #50691:
URL: https://github.com/apache/arrow/pull/50691#discussion_r3667246430
##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -1042,7 +1042,7 @@ if(ARROW_JSON)
json/from_string.cc
json/json_writer_internal.cc
json/object_parser.cc
- json/object_writer.cc
+ json/json_writer.cc
Review Comment:
oh, my bad there should only be `json_writer_internal.cc`, I will fix that.
--
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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "Reranko05 (via GitHub)" <gi...@apache.org>.
Reranko05 commented on code in PR #50691:
URL: https://github.com/apache/arrow/pull/50691#discussion_r3667246430
##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -1042,7 +1042,7 @@ if(ARROW_JSON)
json/from_string.cc
json/json_writer_internal.cc
json/object_parser.cc
- json/object_writer.cc
+ json/json_writer.cc
Review Comment:
oh, my bad it should be `json_writer_internal.cc`, I will fix that.
--
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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #50691:
URL: https://github.com/apache/arrow/pull/50691#issuecomment-5137130805
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 3deec0b119a3fc009e86e473242a6b647eea94e8.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/91027003486) has more details. It also includes information about 2 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-50690: [C++] Migrate ObjectWriter users to JsonWriter [arrow]
Posted by "Reranko05 (via GitHub)" <gi...@apache.org>.
Reranko05 commented on code in PR #50691:
URL: https://github.com/apache/arrow/pull/50691#discussion_r3667560300
##########
cpp/src/parquet/encryption/key_metadata.cc:
##########
@@ -73,15 +73,22 @@ KeyMetadata KeyMetadata::Parse(const std::string& key_metadata) {
// directly
std::string KeyMetadata::CreateSerializedForExternalMaterial(
const std::string& key_reference) {
- ObjectWriter json_writer;
+ JsonWriter json_writer;
- json_writer.SetString(KeyMaterial::kKeyMaterialTypeField,
- KeyMaterial::kKeyMaterialType1);
- json_writer.SetBool(kKeyMaterialInternalStorageField, false);
+ json_writer.StartObject();
- json_writer.SetString(kKeyReferenceField, key_reference);
+ json_writer.Key(KeyMaterial::kKeyMaterialTypeField);
+ json_writer.String(KeyMaterial::kKeyMaterialType1);
- return json_writer.Serialize();
+ json_writer.Key(kKeyMaterialInternalStorageField);
+ json_writer.Bool(false);
+
+ json_writer.Key(kKeyReferenceField);
+ json_writer.String(key_reference);
Review Comment:
I have add `StringField` and `BoolField` helpers since those are the patterns used here, and updated the call sites to use 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