Skip to content

Commit

Permalink
PARQUET-582: Conversions functions for Parquet enums to Thrift enums
Browse files Browse the repository at this point in the history
Author: Uwe L. Korn <[email protected]>

Closes apache#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

Change-Id: I606348148624e52c588b5f78427e547ffc4b5536
  • Loading branch information
xhochy authored and wesm committed Apr 17, 2016
1 parent bba4d52 commit 8af2caf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cpp/src/parquet/thrift/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8af2caf

Please sign in to comment.