Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 08:26:58

0001 // Licensed to the Apache Software Foundation (ASF) under one
0002 // or more contributor license agreements.  See the NOTICE file
0003 // distributed with this work for additional information
0004 // regarding copyright ownership.  The ASF licenses this file
0005 // to you under the Apache License, Version 2.0 (the
0006 // "License"); you may not use this file except in compliance
0007 // with the License.  You may obtain a copy of the License at
0008 //
0009 //   http://www.apache.org/licenses/LICENSE-2.0
0010 //
0011 // Unless required by applicable law or agreed to in writing,
0012 // software distributed under the License is distributed on an
0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0014 // KIND, either express or implied.  See the License for the
0015 // specific language governing permissions and limitations
0016 // under the License.
0017 
0018 #pragma once
0019 
0020 #include "arrow/extension_type.h"
0021 
0022 namespace arrow::extension {
0023 
0024 /// \brief UuidArray stores array of UUIDs. Underlying storage type is
0025 /// FixedSizeBinary(16).
0026 class ARROW_EXPORT UuidArray : public ExtensionArray {
0027  public:
0028   using ExtensionArray::ExtensionArray;
0029 };
0030 
0031 /// \brief UuidType is a canonical arrow extension type for UUIDs.
0032 /// UUIDs are stored as FixedSizeBinary(16) with big-endian notation and this
0033 /// does not interpret the bytes in any way. Specific UUID version is not
0034 /// required or guaranteed.
0035 class ARROW_EXPORT UuidType : public ExtensionType {
0036  public:
0037   /// \brief Construct a UuidType.
0038   UuidType() : ExtensionType(fixed_size_binary(16)) {}
0039 
0040   std::string extension_name() const override { return "arrow.uuid"; }
0041   std::string ToString(bool show_metadata = false) const override;
0042 
0043   bool ExtensionEquals(const ExtensionType& other) const override;
0044 
0045   /// Create a UuidArray from ArrayData
0046   std::shared_ptr<Array> MakeArray(std::shared_ptr<ArrayData> data) const override;
0047 
0048   Result<std::shared_ptr<DataType>> Deserialize(
0049       std::shared_ptr<DataType> storage_type,
0050       const std::string& serialized) const override;
0051 
0052   std::string Serialize() const override { return ""; }
0053 
0054   /// \brief Create a UuidType instance
0055   static Result<std::shared_ptr<DataType>> Make() { return std::make_shared<UuidType>(); }
0056 };
0057 
0058 /// \brief Return a UuidType instance.
0059 ARROW_EXPORT std::shared_ptr<DataType> uuid();
0060 
0061 }  // namespace arrow::extension