emkornfield commented on code in PR #50252:
URL: https://github.com/apache/arrow/pull/50252#discussion_r3841192203


##########
cpp/src/parquet/variant/builder.h:
##########
@@ -0,0 +1,331 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <string_view>
+#include <vector>
+
+#include "arrow/buffer.h"
+#include "arrow/extension/parquet_variant.h"
+#include "arrow/memory_pool.h"
+#include "arrow/type_fwd.h"
+#include "parquet/platform.h"
+
+namespace parquet::variant {
+
+using ::arrow::Array;
+using ::arrow::BinaryViewArray;
+using ::arrow::Buffer;
+using ::arrow::DataType;
+using ::arrow::MemoryPool;
+using ::arrow::StructArray;
+using ::arrow::extension::VariantArray;
+
+class VariantMetadataView;
+class VariantObjectBuilder;
+class VariantListBuilder;
+class VariantValueRowBuilder;
+
+struct PARQUET_EXPORT EncodedVariantValue {
+  std::shared_ptr<Buffer> metadata;
+  std::shared_ptr<Buffer> value;
+};
+
+class PARQUET_EXPORT VariantBuilder {
+ public:
+  explicit VariantBuilder(MemoryPool* pool = ::arrow::default_memory_pool(),
+                          bool validate = true);
+  ~VariantBuilder();
+  VariantBuilder(const VariantBuilder&) = delete;
+  VariantBuilder& operator=(const VariantBuilder&) = delete;
+  VariantBuilder(VariantBuilder&&) noexcept;
+  VariantBuilder& operator=(VariantBuilder&&) noexcept;
+
+  void ReserveFieldNames(int64_t capacity);
+  uint32_t AddFieldName(std::string_view name);
+
+  void AppendVariantNull();
+  void AppendBoolean(bool value);
+  void AppendInt8(int8_t value);
+  void AppendInt16(int16_t value);
+  void AppendInt32(int32_t value);
+  void AppendInt64(int64_t value);
+  void AppendFloat(float value);
+  void AppendDouble(double value);
+  void AppendBinary(std::string_view value);
+  void AppendString(std::string_view value);
+  void AppendDate(int32_t days);
+  void AppendTimeNTZMicros(int64_t micros);
+  void AppendUuid(std::string_view big_endian_bytes);
+  void AppendDecimal4(const ::arrow::Decimal32& value, uint8_t scale);
+  void AppendDecimal8(const ::arrow::Decimal64& value, uint8_t scale);
+  void AppendDecimal16(const ::arrow::Decimal128& value, uint8_t scale);
+  void AppendShortString(std::string_view value);
+  void AppendTimestampMicros(int64_t micros, bool adjusted_to_utc);
+  void AppendTimestampNanos(int64_t nanos, bool adjusted_to_utc);
+  void AppendEncodedValue(std::string_view value);
+
+  /// The returned nested builder borrows this builder's state. This builder 
must

Review Comment:
   make it clear that this applies to both nested options? At least I would 
expect it to?



-- 
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