Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all 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
48 changes: 48 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
language: cpp

compiler:
- gcc
- clang

os:
- linux
- osx

addons:
apt:
packages:
- libboost-dev
#- libsnappy-dev currently handled by thirdparty scipts.
- libboost-program-options-dev #needed for thrift cpp compilation
- libboost-test-dev #needed for thrift cpp compilation
- libssl-dev #needed for thrift cpp compilation
- libtool #needed for thrift cpp compilation
- bison #needed for thrift cpp compilation
- flex #needed for thrift cpp compilation
- pkg-config #needed for thrift cpp compilation

before_install:
- pushd thirdparty
# thrift cpp
- >
if [ $TRAVIS_OS_NAME == linux ]; then
wget http://www.us.apache.org/dist/thrift/0.9.1/thrift-0.9.1.tar.gz &&
tar xfz thrift-0.9.1.tar.gz &&
pushd thrift-0.9.1 &&
./configure --without-qt4 --without-c_glib --without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go --without-d --with-cpp --prefix=$HOME/local &&
make clean &&
make install &&
popd;
fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew install thrift; fi
# snappy and lz4
- ./download_thirdparty.sh
- ./build_thirdparty.sh
- popd

before_script:
- mkdir build
- cd build
- THRIFT_HOME=$HOME/local cmake ..

script: make
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set(CMAKE_PREFIX_PATH ${THIRDPARTY_PREFIX})
# find boost headers and libs
set(Boost_DEBUG TRUE)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost REQUIRED COMPONENTS thread regex-mt system-mt filesystem-mt)
find_package(Boost REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})
message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Parquet-cpp
Parquet-cpp [![Build Status](https://travis-ci.org/apache/parquet-cpp.svg)](https://travis-ci.org/apache/parquet-cpp)
===========
A C++ library to read parquet files.

Expand Down
1 change: 0 additions & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ SET(LINK_LIBS
Parquet
ParquetCompression
Example
rt
ThriftParquet
thriftstatic
lz4static
Expand Down
6 changes: 5 additions & 1 deletion src/impala/bit-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#ifndef IMPALA_BIT_UTIL_H
#define IMPALA_BIT_UTIL_H

#include <endian.h>
#if defined(__APPLE__)
#include <machine/endian.h>
#else
#include <endian.h>
#endif

#include "impala/compiler-util.h"
#include "impala/logging.h"
Expand Down
16 changes: 9 additions & 7 deletions src/util/stopwatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include <iostream>
#include <stdio.h>
#include <ctime>
#include <sys/time.h>

namespace parquet_cpp {

Expand All @@ -26,22 +28,22 @@ class StopWatch {
}

void Start() {
clock_gettime(CLOCK_MONOTONIC, &start_);
gettimeofday(&start_time, 0);
}

// Returns time in nanoseconds.
uint64_t Stop() {
timespec end;
clock_gettime(CLOCK_MONOTONIC, &end);
return (end.tv_sec - start_.tv_sec) * 1000L * 1000L * 1000L +
(end.tv_nsec - start_.tv_nsec);
struct timeval t_time;
gettimeofday(&t_time, 0);

return (1000L * 1000L * 1000L * (t_time.tv_sec - start_time.tv_sec)
+ (t_time.tv_usec - start_time.tv_usec));
}

private:
timespec start_;
struct timeval start_time;
};

}

#endif