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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]