Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 08:27:00

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 <cstdint>
0021 #include <memory>
0022 #include <vector>
0023 
0024 #include "arrow/array.h"
0025 #include "arrow/record_batch.h"
0026 #include "arrow/status.h"
0027 #include "arrow/testing/visibility.h"
0028 #include "arrow/type.h"
0029 
0030 namespace arrow {
0031 namespace ipc {
0032 namespace test {
0033 
0034 // A typedef used for test parameterization
0035 typedef Status MakeRecordBatch(std::shared_ptr<RecordBatch>* out);
0036 
0037 ARROW_TESTING_EXPORT
0038 void CompareArraysDetailed(int index, const Array& result, const Array& expected);
0039 
0040 ARROW_TESTING_EXPORT
0041 void CompareBatchColumnsDetailed(const RecordBatch& result, const RecordBatch& expected);
0042 
0043 ARROW_TESTING_EXPORT
0044 Status MakeRandomInt32Array(int64_t length, bool include_nulls, MemoryPool* pool,
0045                             std::shared_ptr<Array>* out, uint32_t seed = 0,
0046                             int32_t min = 0, int32_t max = 1000);
0047 
0048 ARROW_TESTING_EXPORT
0049 Status MakeRandomInt64Array(int64_t length, bool include_nulls, MemoryPool* pool,
0050                             std::shared_ptr<Array>* out, uint32_t seed = 0);
0051 
0052 ARROW_TESTING_EXPORT
0053 Status MakeRandomListArray(const std::shared_ptr<Array>& child_array, int num_lists,
0054                            bool include_nulls, MemoryPool* pool,
0055                            std::shared_ptr<Array>* out);
0056 
0057 ARROW_TESTING_EXPORT
0058 Status MakeRandomLargeListArray(const std::shared_ptr<Array>& child_array, int num_lists,
0059                                 bool include_nulls, MemoryPool* pool,
0060                                 std::shared_ptr<Array>* out);
0061 
0062 ARROW_TESTING_EXPORT
0063 Status MakeRandomBooleanArray(const int length, bool include_nulls,
0064                               std::shared_ptr<Array>* out);
0065 
0066 ARROW_TESTING_EXPORT
0067 Status MakeBooleanBatchSized(const int length, std::shared_ptr<RecordBatch>* out);
0068 
0069 ARROW_TESTING_EXPORT
0070 Status MakeBooleanBatch(std::shared_ptr<RecordBatch>* out);
0071 
0072 ARROW_TESTING_EXPORT
0073 Status MakeIntBatchSized(int length, std::shared_ptr<RecordBatch>* out,
0074                          uint32_t seed = 0);
0075 
0076 ARROW_TESTING_EXPORT
0077 Status MakeIntRecordBatch(std::shared_ptr<RecordBatch>* out);
0078 
0079 ARROW_TESTING_EXPORT
0080 Status MakeFloat3264BatchSized(int length, std::shared_ptr<RecordBatch>* out,
0081                                uint32_t seed = 0);
0082 
0083 ARROW_TESTING_EXPORT
0084 Status MakeFloat3264Batch(std::shared_ptr<RecordBatch>* out);
0085 
0086 ARROW_TESTING_EXPORT
0087 Status MakeFloatBatchSized(int length, std::shared_ptr<RecordBatch>* out,
0088                            uint32_t seed = 0);
0089 
0090 ARROW_TESTING_EXPORT
0091 Status MakeFloatBatch(std::shared_ptr<RecordBatch>* out);
0092 
0093 ARROW_TESTING_EXPORT
0094 Status MakeRandomStringArray(int64_t length, bool include_nulls, MemoryPool* pool,
0095                              std::shared_ptr<Array>* out);
0096 
0097 ARROW_TESTING_EXPORT
0098 Status MakeStringTypesRecordBatch(std::shared_ptr<RecordBatch>* out,
0099                                   bool with_nulls = true, bool with_view_types = true);
0100 
0101 ARROW_TESTING_EXPORT
0102 Status MakeStringTypesRecordBatchWithNulls(std::shared_ptr<RecordBatch>* out);
0103 
0104 ARROW_TESTING_EXPORT
0105 Status MakeNullRecordBatch(std::shared_ptr<RecordBatch>* out);
0106 
0107 ARROW_TESTING_EXPORT
0108 Status MakeListRecordBatch(std::shared_ptr<RecordBatch>* out);
0109 
0110 ARROW_TESTING_EXPORT
0111 Status MakeListViewRecordBatch(std::shared_ptr<RecordBatch>* out);
0112 
0113 ARROW_TESTING_EXPORT
0114 Status MakeFixedSizeListRecordBatch(std::shared_ptr<RecordBatch>* out);
0115 
0116 ARROW_TESTING_EXPORT
0117 Status MakeZeroLengthRecordBatch(std::shared_ptr<RecordBatch>* out);
0118 
0119 ARROW_TESTING_EXPORT
0120 Status MakeNonNullRecordBatch(std::shared_ptr<RecordBatch>* out);
0121 
0122 ARROW_TESTING_EXPORT
0123 Status MakeDeeplyNestedList(std::shared_ptr<RecordBatch>* out);
0124 
0125 ARROW_TESTING_EXPORT
0126 Status MakeDeeplyNestedListView(std::shared_ptr<RecordBatch>* out);
0127 
0128 ARROW_TESTING_EXPORT
0129 Status MakeStruct(std::shared_ptr<RecordBatch>* out);
0130 
0131 ARROW_TESTING_EXPORT
0132 Status MakeRunEndEncoded(std::shared_ptr<RecordBatch>* out);
0133 
0134 ARROW_TESTING_EXPORT
0135 Status MakeUnion(std::shared_ptr<RecordBatch>* out);
0136 
0137 ARROW_TESTING_EXPORT
0138 Status MakeDictionary(std::shared_ptr<RecordBatch>* out);
0139 
0140 ARROW_TESTING_EXPORT
0141 Status MakeDictionaryFlat(std::shared_ptr<RecordBatch>* out);
0142 
0143 ARROW_TESTING_EXPORT
0144 Status MakeNestedDictionary(std::shared_ptr<RecordBatch>* out);
0145 
0146 ARROW_TESTING_EXPORT
0147 Status MakeMap(std::shared_ptr<RecordBatch>* out);
0148 
0149 ARROW_TESTING_EXPORT
0150 Status MakeMapOfDictionary(std::shared_ptr<RecordBatch>* out);
0151 
0152 ARROW_TESTING_EXPORT
0153 Status MakeDates(std::shared_ptr<RecordBatch>* out);
0154 
0155 ARROW_TESTING_EXPORT
0156 Status MakeTimestamps(std::shared_ptr<RecordBatch>* out);
0157 
0158 ARROW_TESTING_EXPORT
0159 Status MakeIntervals(std::shared_ptr<RecordBatch>* out);
0160 
0161 ARROW_TESTING_EXPORT
0162 Status MakeTimes(std::shared_ptr<RecordBatch>* out);
0163 
0164 ARROW_TESTING_EXPORT
0165 Status MakeFWBinary(std::shared_ptr<RecordBatch>* out);
0166 
0167 ARROW_TESTING_EXPORT
0168 Status MakeDecimal(std::shared_ptr<RecordBatch>* out);
0169 
0170 ARROW_TESTING_EXPORT
0171 Status MakeNull(std::shared_ptr<RecordBatch>* out);
0172 
0173 ARROW_TESTING_EXPORT
0174 Status MakeUuid(std::shared_ptr<RecordBatch>* out);
0175 
0176 ARROW_TESTING_EXPORT
0177 Status MakeComplex128(std::shared_ptr<RecordBatch>* out);
0178 
0179 ARROW_TESTING_EXPORT
0180 Status MakeDictExtension(std::shared_ptr<RecordBatch>* out);
0181 
0182 ARROW_TESTING_EXPORT
0183 Status MakeRandomTensor(const std::shared_ptr<DataType>& type,
0184                         const std::vector<int64_t>& shape, bool row_major_p,
0185                         std::shared_ptr<Tensor>* out, uint32_t seed = 0);
0186 
0187 ARROW_TESTING_EXPORT Status RoundtripBatch(const std::shared_ptr<RecordBatch>& batch,
0188                                            std::shared_ptr<RecordBatch>* out);
0189 
0190 }  // namespace test
0191 }  // namespace ipc
0192 }  // namespace arrow