Skip to content

Commit 7032653

Browse files
committed
Post rebase changes
1 parent 9649d2e commit 7032653

File tree

6 files changed

+10
-22
lines changed

6 files changed

+10
-22
lines changed

cpp/src/arrow/extension/tensor_extension_array_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
namespace arrow {
3737

3838
using FixedShapeTensorType = extension::FixedShapeTensorType;
39+
using arrow::ipc::test::RoundtripBatch;
3940
using extension::fixed_shape_tensor;
4041
using extension::FixedShapeTensorArray;
4142

@@ -807,7 +808,7 @@ TEST_F(TestVariableShapeTensorType, RoudtripBatch) {
807808
std::shared_ptr<RecordBatch> read_batch;
808809
auto ext_field = field(/*name=*/"f0", /*type=*/ext_type_);
809810
auto batch = RecordBatch::Make(schema({ext_field}), ext_arr_->length(), {ext_arr_});
810-
RoundtripBatch(batch, &read_batch);
811+
ASSERT_OK(RoundtripBatch(batch, &read_batch));
811812
CompareBatch(*batch, *read_batch, /*compare_metadata=*/true);
812813

813814
// Pass extension metadata and storage array, expect getting back extension array
@@ -818,7 +819,7 @@ TEST_F(TestVariableShapeTensorType, RoudtripBatch) {
818819
ext_field = field(/*name=*/"f0", /*type=*/ext_type_->storage_type(), /*nullable=*/true,
819820
/*metadata=*/ext_metadata);
820821
auto batch2 = RecordBatch::Make(schema({ext_field}), ext_arr_->length(), {ext_arr_});
821-
RoundtripBatch(batch2, &read_batch2);
822+
ASSERT_OK(RoundtripBatch(batch2, &read_batch2));
822823
CompareBatch(*batch, *read_batch2, /*compare_metadata=*/true);
823824
}
824825

cpp/src/arrow/extension/uuid_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
namespace arrow {
3131

32+
using arrow::ipc::test::RoundtripBatch;
33+
3234
TEST(TestUuuidExtensionType, ExtensionTypeTest) {
3335
auto type = uuid();
3436
ASSERT_EQ(type->id(), Type::EXTENSION);

cpp/src/arrow/extension_type.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
#include "arrow/config.h"
3030
#include "arrow/extension/bool8.h"
3131
#ifdef ARROW_JSON
32-
#include "arrow/extension/fixed_shape_tensor.h"
33-
#include "arrow/extension/opaque.h"
34-
#include "arrow/extension/variable_shape_tensor.h"
32+
# include "arrow/extension/fixed_shape_tensor.h"
33+
# include "arrow/extension/opaque.h"
34+
# include "arrow/extension/variable_shape_tensor.h"
3535
#endif
3636
#include "arrow/extension/json.h"
3737
#include "arrow/extension/uuid.h"

cpp/src/arrow/extension_type_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
#include "arrow/util/key_value_metadata.h"
4141
#include "arrow/util/logging_internal.h"
4242

43+
using arrow::ipc::test::RoundtripBatch;
44+
4345
namespace arrow {
4446

4547
class Parametric1Array : public ExtensionArray {

cpp/src/arrow/testing/gtest_util.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -568,20 +568,6 @@ void ApproxCompareBatch(const RecordBatch& left, const RecordBatch& right,
568568
});
569569
}
570570

571-
void RoundtripBatch(const std::shared_ptr<RecordBatch>& batch,
572-
std::shared_ptr<RecordBatch>* out) {
573-
ASSERT_OK_AND_ASSIGN(auto out_stream, io::BufferOutputStream::Create());
574-
ASSERT_OK(ipc::WriteRecordBatchStream({batch}, ipc::IpcWriteOptions::Defaults(),
575-
out_stream.get()));
576-
577-
ASSERT_OK_AND_ASSIGN(auto complete_ipc_stream, out_stream->Finish());
578-
579-
io::BufferReader reader(complete_ipc_stream);
580-
std::shared_ptr<RecordBatchReader> batch_reader;
581-
ASSERT_OK_AND_ASSIGN(batch_reader, ipc::RecordBatchStreamReader::Open(&reader));
582-
ASSERT_OK(batch_reader->ReadNext(out));
583-
}
584-
585571
std::shared_ptr<Array> TweakValidityBit(const std::shared_ptr<Array>& array,
586572
int64_t index, bool validity) {
587573
auto data = array->data()->Copy();

cpp/src/arrow/testing/gtest_util.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,6 @@ ARROW_TESTING_EXPORT void ApproxCompareBatch(
318318
const RecordBatch& left, const RecordBatch& right, bool compare_metadata = true,
319319
const EqualOptions& options = TestingEqualOptions());
320320

321-
ARROW_TESTING_EXPORT void RoundtripBatch(const std::shared_ptr<RecordBatch>& batch,
322-
std::shared_ptr<RecordBatch>* out);
323-
324321
// Check if the padding of the buffers of the array is zero.
325322
// Also cause valgrind warnings if the padding bytes are uninitialized.
326323
ARROW_TESTING_EXPORT void AssertZeroPadded(const Array& array);

0 commit comments

Comments
 (0)