[Groonga-commit] groonga/groonga at 10fbb09 [master] Support Apache Arrow 0.8.0

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Oct 30 14:14:05 JST 2017


Kouhei Sutou	2017-10-30 14:14:05 +0900 (Mon, 30 Oct 2017)

  New Revision: 10fbb096235bf5151ecd93a6b4095778ade95594
  https://github.com/groonga/groonga/commit/10fbb096235bf5151ecd93a6b4095778ade95594

  Message:
    Support Apache Arrow 0.8.0

  Modified files:
    configure.ac
    lib/arrow.cpp

  Modified: configure.ac (+1 -1)
===================================================================
--- configure.ac    2017-10-30 13:40:26 +0900 (bf61b4135)
+++ configure.ac    2017-10-30 14:14:05 +0900 (62b966d1e)
@@ -956,7 +956,7 @@ AC_ARG_ENABLE(arrow,
 if test "x$enable_arrow" != "xno"; then
   m4_ifdef([PKG_CHECK_MODULES], [
     PKG_CHECK_MODULES([ARROW],
-                      [arrow >= 0.5.0],
+                      [arrow >= 0.8.0],
                       [arrow_available=yes],
                       [arrow_available=no])
   ],

  Modified: lib/arrow.cpp (+8 -8)
===================================================================
--- lib/arrow.cpp    2017-10-30 13:40:26 +0900 (d96231f76)
+++ lib/arrow.cpp    2017-10-30 14:14:05 +0900 (77cc00672)
@@ -353,7 +353,7 @@ namespace grnarrow {
     }
 
     grn_rc load_table(const std::shared_ptr<arrow::Table> &arrow_table) {
-      int n_columns = arrow_table->num_columns();
+      auto n_columns = arrow_table->num_columns();
 
       if (key_column_name_.empty()) {
         grn_obj ids;
@@ -421,7 +421,7 @@ namespace grnarrow {
     grn_rc dump(arrow::io::OutputStream *output) {
       std::vector<std::shared_ptr<arrow::Field>> fields;
       auto n_columns = GRN_BULK_VSIZE(grn_columns_) / sizeof(grn_obj *);
-      for (auto i = 0; i < n_columns; ++i) {
+      for (size_t i = 0; i < n_columns; ++i) {
         auto column = GRN_PTR_VALUE_AT(grn_columns_, i);
 
         char column_name[GRN_TABLE_MAX_KEY_SIZE];
@@ -485,7 +485,7 @@ namespace grnarrow {
 
       auto schema = std::make_shared<arrow::Schema>(fields);
 
-      std::shared_ptr<arrow::ipc::RecordBatchFileWriter> writer;
+      std::shared_ptr<arrow::ipc::RecordBatchWriter> writer;
       auto status =
         arrow::ipc::RecordBatchFileWriter::Open(output, schema, &writer);
       if (!check_status(ctx_,
@@ -495,7 +495,7 @@ namespace grnarrow {
       }
 
       std::vector<grn_id> ids;
-      int n_records_per_batch = 1000;
+      size_t n_records_per_batch = 1000;
       GRN_TABLE_EACH_BEGIN(ctx_, grn_table_, table_cursor, record_id) {
         ids.push_back(record_id);
         if (ids.size() == n_records_per_batch) {
@@ -518,10 +518,10 @@ namespace grnarrow {
 
     void write_record_batch(std::vector<grn_id> &ids,
                             std::shared_ptr<arrow::Schema> &schema,
-                            std::shared_ptr<arrow::ipc::RecordBatchFileWriter> &writer) {
+                            std::shared_ptr<arrow::ipc::RecordBatchWriter> &writer) {
       std::vector<std::shared_ptr<arrow::Array>> columns;
       auto n_columns = GRN_BULK_VSIZE(grn_columns_) / sizeof(grn_obj *);
-      for (auto i = 0; i < n_columns; ++i) {
+      for (size_t i = 0; i < n_columns; ++i) {
         auto grn_column = GRN_PTR_VALUE_AT(grn_columns_, i);
 
         arrow::Status status;
@@ -705,8 +705,8 @@ namespace grnarrow {
                                         std::shared_ptr<arrow::Array> *array) {
       auto timestamp_ns_data_type =
         std::make_shared<arrow::TimestampType>(arrow::TimeUnit::MICRO);
-      arrow::TimestampBuilder builder(arrow::default_memory_pool(),
-                                      timestamp_ns_data_type);
+      arrow::TimestampBuilder builder(timestamp_ns_data_type,
+                                      arrow::default_memory_pool());
       for (auto id : ids) {
         uint32_t size;
         auto data = grn_obj_get_value_(ctx_, grn_column, id, &size);
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171030/8d4013d9/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index