You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@parquet.apache.org by we...@apache.org on 2016/04/17 21:43:39 UTC

parquet-cpp git commit: PARQUET-582: Conversions functions for Parquet enums to Thrift enums

Repository: parquet-cpp
Updated Branches:
  refs/heads/master ee76a3b2f -> 198df4dca


PARQUET-582: Conversions functions for Parquet enums to Thrift enums

Author: Uwe L. Korn <uw...@xhochy.com>

Closes #86 from xhochy/parquet-582 and squashes the following commits:

4fe3cf6 [Uwe L. Korn] Add DCHECK
0a742f6 [Uwe L. Korn] PARQUET-582: Conversions functions for Parquet enums to Thrift enums


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

Branch: refs/heads/master
Commit: 198df4dcae82f65488bb8d5517eee9efd5abeae2
Parents: ee76a3b
Author: Uwe L. Korn <uw...@xhochy.com>
Authored: Sun Apr 17 21:43:29 2016 +0200
Committer: Wes McKinney <we...@apache.org>
Committed: Sun Apr 17 21:43:29 2016 +0200

----------------------------------------------------------------------
 src/parquet/thrift/util.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/198df4dc/src/parquet/thrift/util.h
----------------------------------------------------------------------
diff --git a/src/parquet/thrift/util.h b/src/parquet/thrift/util.h
index 90756fc..287884e 100644
--- a/src/parquet/thrift/util.h
+++ b/src/parquet/thrift/util.h
@@ -48,6 +48,28 @@ static inline Compression::type FromThrift(format::CompressionCodec::type type)
   return static_cast<Compression::type>(type);
 }
 
+static inline format::Type::type ToThrift(Type::type type) {
+  return static_cast<format::Type::type>(type);
+}
+
+static inline format::ConvertedType::type ToThrift(LogicalType::type type) {
+  // item 0 is NONE
+  DCHECK_NE(type, LogicalType::NONE);
+  return static_cast<format::ConvertedType::type>(static_cast<int>(type) - 1);
+}
+
+static inline format::FieldRepetitionType::type ToThrift(Repetition::type type) {
+  return static_cast<format::FieldRepetitionType::type>(type);
+}
+
+static inline format::Encoding::type ToThrift(Encoding::type type) {
+  return static_cast<format::Encoding::type>(type);
+}
+
+static inline format::CompressionCodec::type ToThrift(Compression::type type) {
+  return static_cast<format::CompressionCodec::type>(type);
+}
+
 // ----------------------------------------------------------------------
 // Thrift struct serialization / deserialization utilities