mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 09:05:47 +08:00
Get things compiling again, but tests are broken
This commit is contained in:
1 parent
4efb4e7072
commit
30f1f4d626
15 files changed
+44
-56
No files matched your search
@@ -552,9 +552,9 @@ class TestParquetIO : public ::testing::Test {
|
||||
ASSERT_OK_NO_THROW(writer.Close());
|
||||
}
|
||||
|
||||
void ResetStream() { sink_ = CreateOutputStream(); }
|
||||
void ResetSink() { sink_ = CreateOutputStream(); }
|
||||
|
||||
std::shared_ptr<ArrowOutputStream> sink_;
|
||||
std::shared_ptr<::arrow::io::BufferOutputStream> sink_;
|
||||
};
|
||||
|
||||
// We have separate tests for UInt32Type as this is currently the only type
|
||||
@@ -595,7 +595,7 @@ TYPED_TEST(TestParquetIO, SingleColumnTableRequiredWrite) {
|
||||
ASSERT_OK(NonNullArray<TypeParam>(SMALL_SIZE, &values));
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, false);
|
||||
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_,
|
||||
values->length(), default_writer_properties()));
|
||||
|
||||
@@ -751,7 +751,7 @@ TYPED_TEST(TestParquetIO, SingleColumnTableRequiredChunkedWrite) {
|
||||
ASSERT_OK(NonNullArray<TypeParam>(LARGE_SIZE, &values));
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, false);
|
||||
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, default_memory_pool(), this->sink_, 512,
|
||||
default_writer_properties()));
|
||||
|
||||
@@ -763,7 +763,7 @@ TYPED_TEST(TestParquetIO, SingleColumnTableRequiredChunkedWriteArrowIO) {
|
||||
ASSERT_OK(NonNullArray<TypeParam>(LARGE_SIZE, &values));
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, false);
|
||||
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
auto buffer = AllocateBuffer();
|
||||
|
||||
{
|
||||
@@ -822,7 +822,7 @@ TYPED_TEST(TestParquetIO, SingleColumnTableOptionalChunkedWrite) {
|
||||
|
||||
ASSERT_OK(NullableArray<TypeParam>(LARGE_SIZE, 100, kDefaultSeed, &values));
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, true);
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_, 512,
|
||||
default_writer_properties()));
|
||||
|
||||
@@ -833,7 +833,7 @@ TYPED_TEST(TestParquetIO, FileMetaDataWrite) {
|
||||
std::shared_ptr<Array> values;
|
||||
ASSERT_OK(NonNullArray<TypeParam>(SMALL_SIZE, &values));
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, false);
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_,
|
||||
values->length(), default_writer_properties()));
|
||||
|
||||
@@ -843,7 +843,7 @@ TYPED_TEST(TestParquetIO, FileMetaDataWrite) {
|
||||
ASSERT_EQ(1, metadata->num_columns());
|
||||
ASSERT_EQ(100, metadata->num_rows());
|
||||
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
|
||||
ASSERT_OK_NO_THROW(::parquet::arrow::WriteFileMetaData(*metadata, this->sink_.get()));
|
||||
|
||||
@@ -892,7 +892,7 @@ TEST_F(TestInt96ParquetIO, ReadIntoTimestamp) {
|
||||
|
||||
// We cannot write this column with Arrow, so we have to use the plain parquet-cpp API
|
||||
// to write an Int96 file.
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
auto writer = ParquetFileWriter::Open(this->sink_, schema);
|
||||
RowGroupWriter* rg_writer = writer->AppendRowGroup();
|
||||
ColumnWriter* c_writer = rg_writer->NextColumn();
|
||||
@@ -921,7 +921,7 @@ TEST_F(TestUInt32ParquetIO, Parquet_2_0_Compability) {
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, true);
|
||||
|
||||
// Parquet 2.0 roundtrip should yield an uint32_t column again
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
std::shared_ptr<::parquet::WriterProperties> properties =
|
||||
::parquet::WriterProperties::Builder()
|
||||
.version(ParquetVersion::PARQUET_2_0)
|
||||
@@ -943,7 +943,7 @@ TEST_F(TestUInt32ParquetIO, Parquet_1_0_Compability) {
|
||||
|
||||
// Parquet 1.0 returns an int64_t column as there is no way to tell a Parquet 1.0
|
||||
// reader that a column is unsigned.
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
std::shared_ptr<::parquet::WriterProperties> properties =
|
||||
::parquet::WriterProperties::Builder()
|
||||
.version(ParquetVersion::PARQUET_1_0)
|
||||
@@ -999,7 +999,7 @@ TEST_F(TestStringParquetIO, EmptyStringColumnRequiredWrite) {
|
||||
}
|
||||
ASSERT_OK(builder.Finish(&values));
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, false);
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_,
|
||||
values->length(), default_writer_properties()));
|
||||
|
||||
@@ -1022,7 +1022,7 @@ TEST_F(TestNullParquetIO, NullColumn) {
|
||||
for (int32_t num_rows : {0, SMALL_SIZE}) {
|
||||
std::shared_ptr<Array> values = std::make_shared<::arrow::NullArray>(num_rows);
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(values, true /* nullable */);
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
|
||||
const int64_t chunk_size = std::max(static_cast<int64_t>(1), table->num_rows());
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_,
|
||||
@@ -1052,7 +1052,7 @@ TEST_F(TestNullParquetIO, NullListColumn) {
|
||||
default_memory_pool(), &list_array));
|
||||
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(list_array, false /* nullable */);
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
|
||||
const int64_t chunk_size = std::max(static_cast<int64_t>(1), table->num_rows());
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_,
|
||||
@@ -1081,7 +1081,7 @@ TEST_F(TestNullParquetIO, NullDictionaryColumn) {
|
||||
std::shared_ptr<Array> dict_values =
|
||||
std::make_shared<::arrow::DictionaryArray>(dict_type, indices, dict);
|
||||
std::shared_ptr<Table> table = MakeSimpleTable(dict_values, true);
|
||||
ResetSink();
|
||||
this->ResetSink();
|
||||
ASSERT_OK_NO_THROW(WriteTable(*table, ::arrow::default_memory_pool(), this->sink_,
|
||||
dict_values->length(), default_writer_properties()));
|
||||
|
||||
@@ -2203,7 +2203,7 @@ class TestNestedSchemaRead : public ::testing::TestWithParam<Repetition::type> {
|
||||
std::shared_ptr<::arrow::Int32Array> expected_;
|
||||
};
|
||||
|
||||
std::shared_ptr<ArrowOutputStream> nested_parquet_;
|
||||
std::shared_ptr<::arrow::io::BufferOutputStream> nested_parquet_;
|
||||
std::unique_ptr<FileReader> reader_;
|
||||
std::unique_ptr<ParquetFileWriter> writer_;
|
||||
RowGroupWriter* row_group_writer_;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "arrow/table.h"
|
||||
#include "arrow/type.h"
|
||||
#include "arrow/type_traits.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/int-util.h"
|
||||
#include "arrow/util/logging.h"
|
||||
#include "arrow/util/thread-pool.h"
|
||||
@@ -80,7 +79,6 @@ using parquet::internal::RecordReader;
|
||||
namespace parquet {
|
||||
namespace arrow {
|
||||
|
||||
using ::arrow::BitUtil::BytesForBits;
|
||||
using ::arrow::BitUtil::FromBigEndian;
|
||||
using ::arrow::internal::SafeLeftShift;
|
||||
|
||||
@@ -1118,7 +1116,7 @@ struct TransferFunctor<::arrow::BooleanType, BooleanType> {
|
||||
int64_t length = reader->values_written();
|
||||
std::shared_ptr<Buffer> data;
|
||||
|
||||
const int64_t buffer_size = BytesForBits(length);
|
||||
const int64_t buffer_size = BitUtil::BytesForBits(length);
|
||||
RETURN_NOT_OK(::arrow::AllocateBuffer(pool, buffer_size, &data));
|
||||
|
||||
// Transfer boolean values to packed bitmap
|
||||
@@ -1134,7 +1132,7 @@ struct TransferFunctor<::arrow::BooleanType, BooleanType> {
|
||||
|
||||
if (reader->nullable_values()) {
|
||||
std::shared_ptr<ResizableBuffer> is_valid = reader->ReleaseIsValid();
|
||||
RETURN_NOT_OK(is_valid->Resize(BytesForBits(length), false));
|
||||
RETURN_NOT_OK(is_valid->Resize(BitUtil::BytesForBits(length), false));
|
||||
*out = std::make_shared<BooleanArray>(type, length, data, is_valid,
|
||||
reader->null_count());
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "arrow/buffer.h"
|
||||
#include "arrow/builder.h"
|
||||
#include "arrow/type.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/logging.h"
|
||||
|
||||
#include "parquet/column_page.h"
|
||||
@@ -44,8 +43,6 @@ using arrow::MemoryPool;
|
||||
namespace parquet {
|
||||
namespace internal {
|
||||
|
||||
namespace BitUtil = ::arrow::BitUtil;
|
||||
|
||||
// PLAIN_DICTIONARY is deprecated but used to be used as a dictionary index
|
||||
// encoding.
|
||||
static bool IsDictionaryIndexEncoding(Encoding::type e) {
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "arrow/compute/api.h"
|
||||
#include "arrow/status.h"
|
||||
#include "arrow/table.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/checked_cast.h"
|
||||
#include "arrow/visitor_inline.h"
|
||||
|
||||
@@ -72,8 +71,6 @@ using parquet::schema::GroupNode;
|
||||
namespace parquet {
|
||||
namespace arrow {
|
||||
|
||||
namespace BitUtil = ::arrow::BitUtil;
|
||||
|
||||
std::shared_ptr<ArrowWriterProperties> default_arrow_writer_properties() {
|
||||
static std::shared_ptr<ArrowWriterProperties> default_writer_properties =
|
||||
ArrowWriterProperties::Builder().build();
|
||||
@@ -1133,8 +1130,8 @@ Status FileWriter::Open(const ::arrow::Schema& schema, ::arrow::MemoryPool* pool
|
||||
}
|
||||
|
||||
Status WriteFileMetaData(const FileMetaData& file_metadata,
|
||||
const std::shared_ptr<::arrow::io::OutputStream>& sink) {
|
||||
PARQUET_CATCH_NOT_OK(::parquet::WriteFileMetaData(file_metadata, sink.get()));
|
||||
::arrow::io::OutputStream* sink) {
|
||||
PARQUET_CATCH_NOT_OK(::parquet::WriteFileMetaData(file_metadata, sink));
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "arrow/buffer.h"
|
||||
#include "arrow/io/file.h"
|
||||
#include "arrow/status.h"
|
||||
#include "arrow/testing/gtest_util.h"
|
||||
|
||||
#include "parquet/bloom_filter.h"
|
||||
#include "parquet/exception.h"
|
||||
@@ -196,7 +197,7 @@ TEST(CompatibilityTest, TestBloomFilter) {
|
||||
|
||||
// Serialize Bloom filter to memory output stream
|
||||
auto sink = CreateOutputStream();
|
||||
bloom_filter2.WriteTo(&sink.get());
|
||||
bloom_filter2.WriteTo(sink.get());
|
||||
std::shared_ptr<Buffer> buffer1;
|
||||
PARQUET_THROW_NOT_OK(sink->Finish(&buffer1));
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "arrow/buffer.h"
|
||||
#include "arrow/memory_pool.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/logging.h"
|
||||
#include "parquet/bloom_filter.h"
|
||||
#include "parquet/exception.h"
|
||||
@@ -41,7 +40,7 @@ void BlockSplitBloomFilter::Init(uint32_t num_bytes) {
|
||||
|
||||
// Get next power of 2 if it is not power of 2.
|
||||
if ((num_bytes & (num_bytes - 1)) != 0) {
|
||||
num_bytes = static_cast<uint32_t>(::arrow::BitUtil::NextPower2(num_bytes));
|
||||
num_bytes = static_cast<uint32_t>(BitUtil::NextPower2(num_bytes));
|
||||
}
|
||||
|
||||
if (num_bytes > kMaximumBloomFilterBytes) {
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/logging.h"
|
||||
#include "parquet/hasher.h"
|
||||
#include "parquet/platform.h"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "arrow/buffer.h"
|
||||
#include "arrow/util/bit-stream-utils.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/compression.h"
|
||||
#include "arrow/util/logging.h"
|
||||
#include "arrow/util/rle-encoding.h"
|
||||
@@ -39,8 +38,6 @@ using arrow::MemoryPool;
|
||||
|
||||
namespace parquet {
|
||||
|
||||
namespace BitUtil = ::arrow::BitUtil;
|
||||
|
||||
LevelDecoder::LevelDecoder() : num_values_remaining_(0) {}
|
||||
|
||||
LevelDecoder::~LevelDecoder() {}
|
||||
@@ -155,7 +152,8 @@ std::shared_ptr<Page> SerializedPageReader::NextPage() {
|
||||
// We try to deserialize a larger buffer progressively
|
||||
// until a maximum allowed header limit
|
||||
while (true) {
|
||||
auto buffer = stream_->Peek(allowed_page_size);
|
||||
string_view buffer;
|
||||
PARQUET_THROW_NOT_OK(stream_->Peek(allowed_page_size, &buffer));
|
||||
if (buffer.size() == 0) {
|
||||
return std::shared_ptr<Page>(nullptr);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <arrow/testing/gtest_util.h>
|
||||
#include "arrow/io/buffered.h"
|
||||
#include "arrow/testing/gtest_util.h"
|
||||
|
||||
#include "parquet/column_reader.h"
|
||||
#include "parquet/column_writer.h"
|
||||
@@ -281,7 +282,7 @@ class TestPrimitiveWriter : public PrimitiveTypedTest<TestType> {
|
||||
|
||||
private:
|
||||
std::unique_ptr<ColumnChunkMetaDataBuilder> metadata_;
|
||||
std::shared_ptr<::arrow::io::BufferedOutputStream> sink_;
|
||||
std::shared_ptr<::arrow::io::BufferOutputStream> sink_;
|
||||
std::shared_ptr<WriterProperties> writer_properties_;
|
||||
std::vector<std::vector<uint8_t>> data_buffer_;
|
||||
};
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "arrow/status.h"
|
||||
#include "arrow/util/bit-stream-utils.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/checked_cast.h"
|
||||
#include "arrow/util/compression.h"
|
||||
#include "arrow/util/logging.h"
|
||||
@@ -39,8 +38,6 @@
|
||||
|
||||
namespace parquet {
|
||||
|
||||
namespace BitUtil = ::arrow::BitUtil;
|
||||
|
||||
using ::arrow::internal::checked_cast;
|
||||
|
||||
using BitWriter = ::arrow::BitUtil::BitWriter;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "arrow/testing/random.h"
|
||||
#include "arrow/testing/util.h"
|
||||
#include "arrow/type.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
|
||||
#include "parquet/encoding.h"
|
||||
#include "parquet/platform.h"
|
||||
@@ -52,7 +51,7 @@ namespace test {
|
||||
TEST(VectorBooleanTest, TestEncodeDecode) {
|
||||
// PARQUET-454
|
||||
int nvalues = 10000;
|
||||
int nbytes = static_cast<int>(::arrow::BitUtil::BytesForBits(nvalues));
|
||||
int nbytes = static_cast<int>(BitUtil::BytesForBits(nvalues));
|
||||
|
||||
std::vector<bool> draws;
|
||||
::arrow::random_is_valid(nvalues, 0.5 /* null prob */, &draws, 0 /* seed */);
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "arrow/util/bit-stream-utils.h"
|
||||
#include "arrow/util/bit-util.h"
|
||||
#include "arrow/util/hashing.h"
|
||||
#include "arrow/util/logging.h"
|
||||
#include "arrow/util/rle-encoding.h"
|
||||
@@ -40,8 +39,6 @@ namespace parquet {
|
||||
|
||||
constexpr int64_t kInMemoryDefaultCapacity = 1024;
|
||||
|
||||
namespace BitUtil = ::arrow::BitUtil;
|
||||
|
||||
class EncoderImpl : virtual public Encoder {
|
||||
public:
|
||||
EncoderImpl(const ColumnDescriptor* descr, Encoding::type encoding,
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "arrow/util/bit-util.h"
|
||||
|
||||
#include "parquet/exception.h"
|
||||
#include "parquet/platform.h"
|
||||
#include "parquet/types.h"
|
||||
@@ -146,7 +144,7 @@ class TypedDecoder : virtual public Decoder {
|
||||
// we need to add the spacing from the back.
|
||||
int values_to_move = values_read;
|
||||
for (int i = num_values - 1; i >= 0; i--) {
|
||||
if (::arrow::BitUtil::GetBit(valid_bits, valid_bits_offset + i)) {
|
||||
if (BitUtil::GetBit(valid_bits, valid_bits_offset + i)) {
|
||||
buffer[i] = buffer[--values_to_move];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,14 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "arrow/buffer.h" // IWYU pragma: export
|
||||
#include "arrow/io/interfaces.h" // IWYU pragma: export
|
||||
#include "arrow/io/memory.h" // IWYU pragma: export
|
||||
#include "arrow/memory_pool.h" // IWYU pragma: export
|
||||
#include "arrow/status.h" // IWYU pragma: export
|
||||
#include "arrow/util/macros.h" // IWYU pragma: export
|
||||
#include "arrow/buffer.h" // IWYU pragma: export
|
||||
#include "arrow/io/interfaces.h" // IWYU pragma: export
|
||||
#include "arrow/io/memory.h" // IWYU pragma: export
|
||||
#include "arrow/memory_pool.h" // IWYU pragma: export
|
||||
#include "arrow/status.h" // IWYU pragma: export
|
||||
#include "arrow/util/bit-util.h" // IWYU pragma: export
|
||||
#include "arrow/util/macros.h" // IWYU pragma: export
|
||||
#include "arrow/util/string_view.h" // IWYU pragma: export
|
||||
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
|
||||
@@ -85,6 +87,8 @@
|
||||
|
||||
namespace parquet {
|
||||
|
||||
namespace BitUtil = ::arrow::BitUtil;
|
||||
|
||||
using Buffer = ::arrow::Buffer;
|
||||
using MemoryPool = ::arrow::MemoryPool;
|
||||
using MutableBuffer = ::arrow::MutableBuffer;
|
||||
@@ -93,6 +97,7 @@ using ResizableBuffer = ::arrow::ResizableBuffer;
|
||||
using ArrowInputFile = ::arrow::io::RandomAccessFile;
|
||||
using ArrowInputStream = ::arrow::io::InputStream;
|
||||
using ArrowOutputStream = ::arrow::io::OutputStream;
|
||||
using string_view = ::arrow::util::string_view;
|
||||
|
||||
constexpr int64_t kDefaultOutputStreamSize = 1024;
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "arrow/testing/gtest_util.h"
|
||||
|
||||
#include "parquet/column_reader.h"
|
||||
#include "parquet/column_writer.h"
|
||||
#include "parquet/file_reader.h"
|
||||
@@ -670,7 +672,7 @@ class TestStatisticsSortOrder : public ::testing::Test {
|
||||
std::vector<uint8_t> values_buf_;
|
||||
std::vector<schema::NodePtr> fields_;
|
||||
std::shared_ptr<schema::GroupNode> schema_;
|
||||
std::shared_ptr<ArrowOutputStream> parquet_sink_;
|
||||
std::shared_ptr<::arrow::io::BufferOutputStream> parquet_sink_;
|
||||
std::vector<EncodedStatistics> stats_;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user