Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ matrix:
- export ARROW_TRAVIS_VALGRIND=1
- export ARROW_TRAVIS_PLASMA=1
- export ARROW_TRAVIS_CLANG_FORMAT=1
- export ARROW_BUILD_WARNING_LEVEL=CHECKIN
- export CC="clang-4.0"
- export CXX="clang++-4.0"
- $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh
Expand All @@ -74,6 +75,7 @@ matrix:
before_script:
- export ARROW_TRAVIS_USE_TOOLCHAIN=1
- export ARROW_TRAVIS_PLASMA=1
- export ARROW_BUILD_WARNING_LEVEL=CHECKIN
- travis_wait 50 $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
script:
- $TRAVIS_BUILD_DIR/ci/travis_script_cpp.sh
Expand Down Expand Up @@ -109,6 +111,7 @@ matrix:
- export CC="clang-4.0"
- export CXX="clang++-4.0"
- nvm install node
- export ARROW_BUILD_TYPE=release
- $TRAVIS_BUILD_DIR/ci/travis_lint.sh
- $TRAVIS_BUILD_DIR/ci/travis_before_script_js.sh
- $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
Expand Down
5 changes: 2 additions & 3 deletions c_glib/arrow-glib/record-batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,8 @@ garrow_record_batch_new(GArrowSchema *schema,
}

auto arrow_record_batch =
std::make_shared<arrow::RecordBatch>(garrow_schema_get_raw(schema),
n_rows,
arrow_columns);
arrow::RecordBatch::Make(garrow_schema_get_raw(schema),
n_rows, arrow_columns);
return garrow_record_batch_new_raw(&arrow_record_batch);
}

Expand Down
3 changes: 1 addition & 2 deletions c_glib/arrow-glib/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ garrow_table_new(GArrowSchema *schema,
}

auto arrow_table =
std::make_shared<arrow::Table>(garrow_schema_get_raw(schema),
arrow_columns);
arrow::Table::Make(garrow_schema_get_raw(schema), arrow_columns);
return garrow_table_new_raw(&arrow_table);
}

Expand Down
6 changes: 4 additions & 2 deletions ci/travis_before_script_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ fi
if [ $TRAVIS_OS_NAME == "linux" ]; then
cmake $CMAKE_COMMON_FLAGS \
$CMAKE_LINUX_FLAGS \
-DBUILD_WARNING_LEVEL=CHECKIN \
-DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \
-DBUILD_WARNING_LEVEL=$ARROW_BUILD_WARNING_LEVEL \
$ARROW_CPP_DIR
else
cmake $CMAKE_COMMON_FLAGS \
$CMAKE_OSX_FLAGS \
-DBUILD_WARNING_LEVEL=CHECKIN \
-DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \
-DBUILD_WARNING_LEVEL=$ARROW_BUILD_WARNING_LEVEL \
$ARROW_CPP_DIR
fi

Expand Down
3 changes: 3 additions & 0 deletions ci/travis_env_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export ARROW_PYTHON_PARQUET_HOME=$TRAVIS_BUILD_DIR/parquet-env

export CMAKE_EXPORT_COMPILE_COMMANDS=1

export ARROW_BUILD_TYPE=${ARROW_BUILD_TYPE:=debug}
export ARROW_BUILD_WARNING_LEVEL=${ARROW_BUILD_WARNING_LEVEL:=Production}

if [ "$ARROW_TRAVIS_USE_TOOLCHAIN" == "1" ]; then
# C++ toolchain
export CPP_TOOLCHAIN=$TRAVIS_BUILD_DIR/cpp-toolchain
Expand Down
3 changes: 3 additions & 0 deletions ci/travis_script_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ cmake -GNinja \
-DARROW_BUILD_UTILITIES=off \
-DARROW_PLASMA=on \
-DARROW_PYTHON=on \
-DCMAKE_BUILD_TYPE=$ARROW_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
$ARROW_CPP_DIR

Expand All @@ -78,6 +79,8 @@ if [ "$PYTHON_VERSION" == "2.7" ]; then
pip install futures
fi

export PYARROW_BUILD_TYPE=$ARROW_BUILD_TYPE

pip install -r requirements.txt
python setup.py build_ext --with-parquet --with-plasma \
install --single-version-externally-managed --record=record.text
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set(ARROW_SRCS
compare.cc
memory_pool.cc
pretty_print.cc
record_batch.cc
status.cc
table.cc
table_builder.cc
Expand Down Expand Up @@ -144,6 +145,7 @@ install(FILES
compare.h
memory_pool.h
pretty_print.h
record_batch.h
status.h
table.h
table_builder.h
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "arrow/compare.h"
#include "arrow/memory_pool.h"
#include "arrow/pretty_print.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/table_builder.h"
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ class ARROW_EXPORT Array {
ARROW_DISALLOW_COPY_AND_ASSIGN(Array);
};

using ArrayVector = std::vector<std::shared_ptr<Array>>;

static inline std::ostream& operator<<(std::ostream& os, const Array& x) {
os << x.ToString();
return os;
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "arrow/buffer.h"
#include "arrow/compare.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
#include "arrow/util/bit-util.h"
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "arrow/buffer.h"
#include "arrow/memory_pool.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
#include "arrow/util/bit-util.h"
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/column-benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "arrow/array.h"
#include "arrow/memory_pool.h"
#include "arrow/table.h"
#include "arrow/test-util.h"

namespace arrow {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/compute/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vector>

#include "arrow/array.h"
#include "arrow/record_batch.h"
#include "arrow/table.h"
#include "arrow/util/macros.h"
#include "arrow/util/variant.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/gpu/cuda_arrow_ipc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "arrow/ipc/message.h"
#include "arrow/ipc/reader.h"
#include "arrow/ipc/writer.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/util/visibility.h"

#include "arrow/gpu/cuda_context.h"
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/arrow/ipc/feather-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "arrow/ipc/feather.h"
#include "arrow/ipc/test-common.h"
#include "arrow/pretty_print.h"
#include "arrow/table.h"
#include "arrow/test-util.h"

namespace arrow {
Expand Down Expand Up @@ -376,8 +377,8 @@ TEST_F(TestTableWriter, TimeTypes) {
schema->field(i)->type(), values->length(), buffers, values->null_count(), 0));
}

RecordBatch batch(schema, values->length(), std::move(arrays));
CheckBatch(batch);
auto batch = RecordBatch::Make(schema, values->length(), std::move(arrays));
CheckBatch(*batch);
}

TEST_F(TestTableWriter, VLenPrimitiveRoundTrip) {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/ipc/feather.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "arrow/ipc/feather-internal.h"
#include "arrow/ipc/feather_generated.h"
#include "arrow/ipc/util.h" // IWYU pragma: keep
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/type.h"
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/ipc/ipc-json-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "arrow/ipc/json.h"
#include "arrow/ipc/test-common.h"
#include "arrow/memory_pool.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/test-util.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
Expand Down Expand Up @@ -269,7 +269,7 @@ TEST(TestJsonFileReadWrite, BasicRoundTrip) {
std::vector<std::shared_ptr<Array>> arrays;

MakeBatchArrays(schema, num_rows, &arrays);
auto batch = std::make_shared<RecordBatch>(schema, num_rows, arrays);
auto batch = RecordBatch::Make(schema, num_rows, arrays);
batches.push_back(batch);
ASSERT_OK(writer->WriteRecordBatch(*batch));
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/ipc/ipc-read-write-benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ std::shared_ptr<RecordBatch> MakeRecordBatch(int64_t total_size, int64_t num_fie
}

auto schema = std::make_shared<Schema>(fields);
return std::make_shared<RecordBatch>(schema, length, arrays);
return RecordBatch::Make(schema, length, arrays);
}

static void BM_WriteRecordBatch(benchmark::State& state) { // NOLINT non-const reference
Expand Down
19 changes: 9 additions & 10 deletions cpp/src/arrow/ipc/ipc-read-write-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ class IpcTestFixture : public io::MemoryMapFixture {
std::vector<std::shared_ptr<Field>> fields = {f0};
auto schema = std::make_shared<Schema>(fields);

RecordBatch batch(schema, 0, {array});
CheckRoundtrip(batch, buffer_size);
auto batch = RecordBatch::Make(schema, 0, {array});
CheckRoundtrip(*batch, buffer_size);
}

protected:
Expand Down Expand Up @@ -292,13 +292,13 @@ TEST_F(TestWriteRecordBatch, SliceTruncatesBuffers) {
auto CheckArray = [this](const std::shared_ptr<Array>& array) {
auto f0 = field("f0", array->type());
auto schema = ::arrow::schema({f0});
RecordBatch batch(schema, array->length(), {array});
auto sliced_batch = batch.Slice(0, 5);
auto batch = RecordBatch::Make(schema, array->length(), {array});
auto sliced_batch = batch->Slice(0, 5);

int64_t full_size;
int64_t sliced_size;

ASSERT_OK(GetRecordBatchSize(batch, &full_size));
ASSERT_OK(GetRecordBatchSize(*batch, &full_size));
ASSERT_OK(GetRecordBatchSize(*sliced_batch, &sliced_size));
ASSERT_TRUE(sliced_size < full_size) << sliced_size << " " << full_size;

Expand Down Expand Up @@ -411,8 +411,7 @@ class RecursionLimits : public ::testing::Test, public io::MemoryMapFixture {

*schema = ::arrow::schema({f0});

std::vector<std::shared_ptr<Array>> arrays = {array};
*batch = std::make_shared<RecordBatch>(*schema, batch_length, arrays);
*batch = RecordBatch::Make(*schema, batch_length, {array});

std::stringstream ss;
ss << "test-write-past-max-recursion-" << g_file_number++;
Expand Down Expand Up @@ -632,7 +631,7 @@ TEST_F(TestIpcRoundTrip, LargeRecordBatch) {
std::vector<std::shared_ptr<Field>> fields = {f0};
auto schema = std::make_shared<Schema>(fields);

RecordBatch batch(schema, length, {array});
auto batch = RecordBatch::Make(schema, length, {array});

std::string path = "test-write-large-record_batch";

Expand All @@ -641,8 +640,8 @@ TEST_F(TestIpcRoundTrip, LargeRecordBatch) {
ASSERT_OK(io::MemoryMapFixture::InitMemoryMap(kBufferSize, path, &mmap_));

std::shared_ptr<RecordBatch> result;
ASSERT_OK(DoLargeRoundTrip(batch, false, &result));
CheckReadResult(*result, batch);
ASSERT_OK(DoLargeRoundTrip(*batch, false, &result));
CheckReadResult(*result, *batch);

ASSERT_EQ(length, result->num_rows());
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/ipc/json-integration-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "arrow/ipc/reader.h"
#include "arrow/ipc/writer.h"
#include "arrow/pretty_print.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/test-util.h"
#include "arrow/type.h"

Expand Down
8 changes: 4 additions & 4 deletions cpp/src/arrow/ipc/json-internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "arrow/array.h"
#include "arrow/builder.h"
#include "arrow/ipc/dictionary.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/type.h"
#include "arrow/type_traits.h"
#include "arrow/util/bit-util.h"
Expand Down Expand Up @@ -125,8 +125,8 @@ class SchemaWriter {

// Make a dummy record batch. A bit tedious as we have to make a schema
auto schema = ::arrow::schema({arrow::field("dictionary", dictionary->type())});
RecordBatch batch(schema, dictionary->length(), {dictionary});
RETURN_NOT_OK(WriteRecordBatch(batch, writer_));
auto batch = RecordBatch::Make(schema, dictionary->length(), {dictionary});
RETURN_NOT_OK(WriteRecordBatch(*batch, writer_));
writer_->EndObject();
return Status::OK();
}
Expand Down Expand Up @@ -1435,7 +1435,7 @@ Status ReadRecordBatch(const rj::Value& json_obj, const std::shared_ptr<Schema>&
RETURN_NOT_OK(ReadArray(pool, json_columns[i], type, &columns[i]));
}

*batch = std::make_shared<RecordBatch>(schema, num_rows, columns);
*batch = RecordBatch::Make(schema, num_rows, columns);
return Status::OK();
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/ipc/json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "arrow/buffer.h"
#include "arrow/ipc/json-internal.h"
#include "arrow/memory_pool.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/type.h"
#include "arrow/util/logging.h"

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/ipc/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include "arrow/ipc/message.h"
#include "arrow/ipc/metadata-internal.h"
#include "arrow/ipc/util.h"
#include "arrow/record_batch.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/tensor.h"
#include "arrow/type.h"
#include "arrow/util/bit-util.h"
Expand Down Expand Up @@ -307,7 +307,7 @@ static Status LoadRecordBatchFromSource(const std::shared_ptr<Schema>& schema,
arrays[i] = std::move(arr);
}

*out = std::make_shared<RecordBatch>(schema, num_rows, std::move(arrays));
*out = RecordBatch::Make(schema, num_rows, std::move(arrays));
return Status::OK();
}

Expand Down
3 changes: 1 addition & 2 deletions cpp/src/arrow/ipc/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
#include <memory>

#include "arrow/ipc/message.h"
#include "arrow/table.h"
#include "arrow/record_batch.h"
#include "arrow/util/visibility.h"

namespace arrow {

class Buffer;
class RecordBatch;
class Schema;
class Status;
class Tensor;
Expand Down
Loading