You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by uw...@apache.org on 2017/03/25 13:33:07 UTC

parquet-cpp git commit: PARQUET-923: Account for Time type changes in Arrow

Repository: parquet-cpp
Updated Branches:
  refs/heads/master 02a9f0dbf -> 4ef7222b3


PARQUET-923: Account for Time type changes in Arrow

Needs ARROW-709 (https://github.com/apache/arrow/pull/439), will update Arrow commit hash once that's done

Author: Wes McKinney <we...@twosigma.com>

Closes #273 from wesm/PARQUET-923 and squashes the following commits:

822525e [Wes McKinney] Bump Arrow version for ARROW-709
7844545 [Wes McKinney] Account for Time type changes in Arrow


Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/4ef7222b
Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/4ef7222b
Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/4ef7222b

Branch: refs/heads/master
Commit: 4ef7222b32d9c3314334a863e29599d70c898d82
Parents: 02a9f0d
Author: Wes McKinney <we...@twosigma.com>
Authored: Sat Mar 25 14:32:50 2017 +0100
Committer: Uwe L. Korn <uw...@apache.org>
Committed: Sat Mar 25 14:32:50 2017 +0100

----------------------------------------------------------------------
 cmake_modules/ThirdpartyToolchain.cmake |  2 +-
 src/parquet/arrow/schema.cc             | 12 +++++++++++-
 src/parquet/arrow/writer.cc             |  3 ++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/4ef7222b/cmake_modules/ThirdpartyToolchain.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index 1e43308..6871174 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -22,7 +22,7 @@ set(THRIFT_VERSION "0.10.0")
 
 # Brotli 0.5.2 does not install headers/libraries yet, but 0.6.0.dev does
 set(BROTLI_VERSION "5db62dcc9d386579609540cdf8869e95ad334bbd")
-set(ARROW_VERSION "e8f6a492d30d32cd67fe3a537b3aec4cbae566c9")
+set(ARROW_VERSION "c7947dc2d08a0a2295016d34db201cc38a38360c")
 
 # find boost headers and libs
 # Find shared Boost libraries.

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/4ef7222b/src/parquet/arrow/schema.cc
----------------------------------------------------------------------
diff --git a/src/parquet/arrow/schema.cc b/src/parquet/arrow/schema.cc
index ed989cb..f0d05fc 100644
--- a/src/parquet/arrow/schema.cc
+++ b/src/parquet/arrow/schema.cc
@@ -110,6 +110,12 @@ static Status FromInt32(const PrimitiveNode* node, TypePtr* out) {
     case LogicalType::DATE:
       *out = ::arrow::date64();
       break;
+    case LogicalType::TIME_MILLIS:
+      *out = ::arrow::time32(::arrow::TimeUnit::MILLI);
+      break;
+    case LogicalType::TIME_MICROS:
+      *out = ::arrow::time64(::arrow::TimeUnit::MICRO);
+      break;
     case LogicalType::DECIMAL:
       *out = MakeDecimalType(node);
       break;
@@ -395,10 +401,14 @@ Status FieldToNode(const std::shared_ptr<Field>& field,
       type = ParquetType::INT64;
       logical_type = LogicalType::TIMESTAMP_MILLIS;
     } break;
-    case ArrowType::TIME:
+    case ArrowType::TIME32:
       type = ParquetType::INT64;
       logical_type = LogicalType::TIME_MILLIS;
       break;
+    case ArrowType::TIME64:
+      type = ParquetType::INT64;
+      logical_type = LogicalType::TIME_MICROS;
+      break;
     case ArrowType::STRUCT: {
       auto struct_type = std::static_pointer_cast<::arrow::StructType>(field->type);
       return StructToNode(struct_type, field->name, field->nullable, properties, out);

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/4ef7222b/src/parquet/arrow/writer.cc
----------------------------------------------------------------------
diff --git a/src/parquet/arrow/writer.cc b/src/parquet/arrow/writer.cc
index f2ee734..a92537a 100644
--- a/src/parquet/arrow/writer.cc
+++ b/src/parquet/arrow/writer.cc
@@ -81,7 +81,8 @@ class LevelBuilder : public ::arrow::ArrayVisitor {
   PRIMITIVE_VISIT(String)
   PRIMITIVE_VISIT(Binary)
   PRIMITIVE_VISIT(Date64)
-  PRIMITIVE_VISIT(Time)
+  PRIMITIVE_VISIT(Time32)
+  PRIMITIVE_VISIT(Time64)
   PRIMITIVE_VISIT(Timestamp)
   PRIMITIVE_VISIT(Interval)