[ 
https://issues.apache.org/jira/browse/ORC-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16672112#comment-16672112
 ] 

ASF GitHub Bot commented on ORC-423:
------------------------------------

omalley closed pull request #332: ORC-423 Add debian 9 and ubuntu 18 docker 
files
URL: https://github.com/apache/orc/pull/332
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/c++/include/orc/Exceptions.hh b/c++/include/orc/Exceptions.hh
index 2037c96615..9765d4fd6b 100644
--- a/c++/include/orc/Exceptions.hh
+++ b/c++/include/orc/Exceptions.hh
@@ -30,7 +30,7 @@ namespace orc {
   public:
     explicit NotImplementedYet(const std::string& what_arg);
     explicit NotImplementedYet(const char* what_arg);
-    virtual ~NotImplementedYet() noexcept;
+    virtual ~NotImplementedYet() ORC_NOEXCEPT;
     NotImplementedYet(const NotImplementedYet&);
   private:
     NotImplementedYet& operator=(const NotImplementedYet&);
@@ -40,7 +40,7 @@ namespace orc {
   public:
     explicit ParseError(const std::string& what_arg);
     explicit ParseError(const char* what_arg);
-    virtual ~ParseError() noexcept;
+    virtual ~ParseError() ORC_NOEXCEPT;
     ParseError(const ParseError&);
   private:
     ParseError& operator=(const ParseError&);
@@ -50,7 +50,7 @@ namespace orc {
   public:
     explicit InvalidArgument(const std::string& what_arg);
     explicit InvalidArgument(const char* what_arg);
-    virtual ~InvalidArgument() noexcept;
+    virtual ~InvalidArgument() ORC_NOEXCEPT;
     InvalidArgument(const InvalidArgument&);
   private:
     InvalidArgument& operator=(const InvalidArgument&);
diff --git a/c++/src/Adaptor.hh.in b/c++/src/Adaptor.hh.in
index d7257429ac..e14e2af0bd 100644
--- a/c++/src/Adaptor.hh.in
+++ b/c++/src/Adaptor.hh.in
@@ -24,6 +24,8 @@
 #cmakedefine HAS_STRPTIME
 #cmakedefine HAS_STOLL
 #cmakedefine HAS_DIAGNOSTIC_PUSH
+#cmakedefine HAS_DOUBLE_TO_STRING
+#cmakedefine HAS_INT64_TO_STRING
 #cmakedefine HAS_PRE_1970
 #cmakedefine HAS_POST_2038
 #cmakedefine HAS_STD_ISNAN
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 91c67d5048..73583612f2 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -98,6 +98,25 @@ CHECK_CXX_SOURCE_COMPILES("
   NEEDS_REDUNDANT_MOVE
 )
 
+CHECK_CXX_SOURCE_COMPILES("
+    #include<string>
+    int main(int, char *[]) {
+      double d = 5;
+      std::to_string(d);
+    }"
+  HAS_DOUBLE_TO_STRING
+)
+
+CHECK_CXX_SOURCE_COMPILES("
+    #include<cstdint>
+    #include<string>
+    int main(int, char *[]) {
+      int64_t d = 5;
+      std::to_string(d);
+    }"
+  HAS_INT64_TO_STRING
+)
+
 INCLUDE(CheckCXXSourceRuns)
 
 CHECK_CXX_SOURCE_RUNS("
@@ -204,4 +223,4 @@ target_link_libraries (orc
   ${LIBHDFSPP_LIBRARIES}
   )
 
-install(TARGETS orc DESTINATION lib)
\ No newline at end of file
+install(TARGETS orc DESTINATION lib)
diff --git a/c++/src/Exceptions.cc b/c++/src/Exceptions.cc
index 4bcd24ef30..2077b27df4 100644
--- a/c++/src/Exceptions.cc
+++ b/c++/src/Exceptions.cc
@@ -35,7 +35,7 @@ namespace orc {
     // PASS
   }
 
-  NotImplementedYet::~NotImplementedYet() noexcept {
+  NotImplementedYet::~NotImplementedYet() ORC_NOEXCEPT {
     // PASS
   }
 
@@ -53,7 +53,7 @@ namespace orc {
     // PASS
   }
 
-  ParseError::~ParseError() noexcept {
+  ParseError::~ParseError() ORC_NOEXCEPT {
     // PASS
   }
 
@@ -72,7 +72,7 @@ namespace orc {
     // PASS
   }
 
-  InvalidArgument::~InvalidArgument() noexcept {
+  InvalidArgument::~InvalidArgument() ORC_NOEXCEPT {
     // PASS
   }
 }
diff --git a/c++/src/RLEv1.cc b/c++/src/RLEv1.cc
index d8b5541d70..fe333978db 100644
--- a/c++/src/RLEv1.cc
+++ b/c++/src/RLEv1.cc
@@ -25,14 +25,14 @@
 
 namespace orc {
 
-const int MINIMUM_REPEAT = 3;
-const int MAXIMUM_REPEAT = 127 + MINIMUM_REPEAT;
+const uint64_t MINIMUM_REPEAT = 3;
+const uint64_t MAXIMUM_REPEAT = 127 + MINIMUM_REPEAT;
 
 const int64_t BASE_128_MASK = 0x7f;
 
-const int MAX_DELTA = 127;
-const int MIN_DELTA = -128;
-const int MAX_LITERAL_SIZE = 128;
+const int64_t MAX_DELTA = 127;
+const int64_t MIN_DELTA = -128;
+const uint64_t MAX_LITERAL_SIZE = 128;
 
 RleEncoderV1::RleEncoderV1(
                           std::unique_ptr<BufferedOutputStream> outStream,
diff --git a/c++/src/RLEv1.hh b/c++/src/RLEv1.hh
index b83c51cede..26a180e32a 100644
--- a/c++/src/RLEv1.hh
+++ b/c++/src/RLEv1.hh
@@ -40,7 +40,7 @@ public:
 private:
     int64_t delta;
     bool repeat;
-    int tailRunLength;
+    uint64_t tailRunLength;
 
     void write(int64_t val) override;
     void writeValues();
diff --git a/c++/src/RleEncoderV2.cc b/c++/src/RleEncoderV2.cc
index 4bd4c9ddc8..c5c786044c 100644
--- a/c++/src/RleEncoderV2.cc
+++ b/c++/src/RleEncoderV2.cc
@@ -26,6 +26,26 @@
 
 namespace orc {
 
+#ifdef HAS_DOUBLE_TO_STRING
+  std::string to_string(double val) {
+    return std::to_string(val);
+  }
+#else
+  std::string to_string(double val) {
+    return std::to_string(static_cast<long double>(val));
+  }
+#endif
+
+#ifdef HAS_INT64_TO_STRING
+  std::string to_string(int64_t val) {
+    return std::to_string(val);
+  }
+#else
+  std::string to_string(int64_t val) {
+    return std::to_string(static_cast<long long int>(val));
+  }
+#endif
+
 /**
  * Compute the bits required to represent pth percentile value
  * @param data - array
@@ -34,7 +54,7 @@ namespace orc {
  */
 uint32_t RleEncoderV2::percentileBits(int64_t* data, size_t offset, size_t 
length, double p, bool reuseHist) {
     if ((p > 1.0) || (p <= 0.0)) {
-        throw InvalidArgument("Invalid p value: " + std::to_string(p));
+        throw InvalidArgument("Invalid p value: " + to_string(p));
     }
 
     if (!reuseHist) {
@@ -342,11 +362,13 @@ void RleEncoderV2::determineEncoding(EncodingOption& 
option) {
     // fixed values run >10 which cannot be encoded with SHORT_REPEAT
     if (option.min == max) {
         if (!option.isFixedDelta) {
-            throw InvalidArgument(std::to_string(option.min) + "==" + 
std::to_string(max) + ", isFixedDelta cannot be false");
+            throw InvalidArgument(to_string(option.min) + "==" +
+              to_string(max) + ", isFixedDelta cannot be false");
         }
 
         if(currDelta != 0) {
-            throw InvalidArgument(std::to_string(option.min) + "==" + 
std::to_string(max) + ", currDelta should be zero");
+            throw InvalidArgument(to_string(option.min) + "==" +
+            to_string(max) + ", currDelta should be zero");
         }
         option.fixedDelta = 0;
         option.encoding = DELTA;
diff --git a/c++/test/TestRleEncoder.cc b/c++/test/TestRleEncoder.cc
index 74ce86d61a..ceb4d05b1f 100644
--- a/c++/test/TestRleEncoder.cc
+++ b/c++/test/TestRleEncoder.cc
@@ -40,7 +40,7 @@ namespace orc {
     virtual void SetUp();
 
   protected:
-    bool alignBitpacking = true;
+    bool alignBitpacking;
     std::unique_ptr<RleEncoder> getEncoder(RleVersion version,
                                            MemoryOutputStream& memStream,
                                            bool isSigned);
diff --git a/c++/test/TestWriter.cc b/c++/test/TestWriter.cc
index 330d0d7130..c86c0252de 100644
--- a/c++/test/TestWriter.cc
+++ b/c++/test/TestWriter.cc
@@ -78,7 +78,9 @@ namespace orc {
     virtual void SetUp();
 
     protected:
-      FileVersion fileVersion = FileVersion::v_0_11();
+      FileVersion fileVersion;
+    public:
+      WriterTest(): fileVersion(FileVersion::v_0_11()) {}
   };
 
   void WriterTest::SetUp() {
diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
index 027226345a..8aabf69a3d 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -135,6 +135,7 @@ else ()
   set(LZ4_INCLUDE_DIR "${LZ4_PREFIX}/include")
   set(LZ4_STATIC_LIB 
"${LZ4_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lz4${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(LZ4_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LZ4_PREFIX}
+                     -DCMAKE_INSTALL_LIBDIR=lib
                      -DBUILD_SHARED_LIBS=OFF)
 
   if (CMAKE_VERSION VERSION_GREATER "3.7")
@@ -237,6 +238,7 @@ else ()
   set(PROTOBUF_PREFIX "${THIRDPARTY_DIR}/protobuf_ep-install")
   set(PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include")
   set(PROTOBUF_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PROTOBUF_PREFIX}
+                          -DCMAKE_INSTALL_LIBDIR=lib
                           -DBUILD_SHARED_LIBS=OFF
                           -Dprotobuf_BUILD_TESTS=OFF)
   if (MSVC)
diff --git a/docker/.gitignore b/docker/.gitignore
new file mode 100644
index 0000000000..cd3d225360
--- /dev/null
+++ b/docker/.gitignore
@@ -0,0 +1 @@
+logs
\ No newline at end of file
diff --git a/docker/README b/docker/README
index cadedb2146..bf03a4c0a4 100644
--- a/docker/README
+++ b/docker/README
@@ -9,3 +9,7 @@ To run the docker scripts:
 1. cd $os
 2. docker build -t orc-$os .
 3. docker run orc-$os
+
+To clean up docker:
+1. docker container prune
+2. docker image prune
diff --git a/docker/centos6/Dockerfile b/docker/centos6/Dockerfile
index f83c9b3738..9f6a801561 100644
--- a/docker/centos6/Dockerfile
+++ b/docker/centos6/Dockerfile
@@ -29,8 +29,9 @@ RUN yum install -y \
   gcc-c++ \
   gettext-devel \
   git \
-  java-1.7.0-openjdk \
-  java-1.7.0-openjdk-devel \
+  java-1.8.0-openjdk \
+  java-1.8.0-openjdk-devel \
+  libtool \
   make \
   openssl-devel \
   tar \
@@ -42,6 +43,22 @@ WORKDIR /root
 RUN wget 
"https://www.apache.org/dyn/closer.lua?action=download&filename=/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz";
 -O maven.tgz
 RUN tar xzf maven.tgz
 RUN ln -s /root/apache-maven-3.3.9/bin/mvn /usr/bin/mvn
+# install a local build of protobuf
+RUN wget "https://github.com/protocolbuffers/protobuf/archive/v2.5.0.tar.gz"; \
+  -O protobuf.tgz
+RUN tar xzf protobuf.tgz
+RUN cd protobuf-2.5.0 && \
+    autoreconf -f -i -Wall,no-obsolete && \
+    ./configure && \
+    make install
+# install a local build of snappy
+RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz"; \
+  -O snappy.tgz
+RUN tar xzf snappy.tgz
+RUN cd snappy-1.1.3 && \
+    ./autogen.sh && \
+    ./configure && \
+    make install
 
 CMD git clone https://github.com/apache/orc.git -b master && \
   mkdir orc/build && \
diff --git a/docker/centos7/Dockerfile b/docker/centos7/Dockerfile
index 64adb14830..8951a1d033 100644
--- a/docker/centos7/Dockerfile
+++ b/docker/centos7/Dockerfile
@@ -30,16 +30,27 @@ RUN yum install -y \
   gcc-c++ \
   gettext-devel \
   git \
-  java-1.7.0-openjdk \
-  java-1.7.0-openjdk-devel \
+  java-1.8.0-openjdk \
+  java-1.8.0-openjdk-devel \
+  libtool \
   make \
   maven \
   openssl-devel \
+  tar \
+  wget \
   which \
   zlib-devel
 
 ENV TZ=America/Los_Angeles
 WORKDIR /root
+# install a local build of snappy
+RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz"; \
+  -O snappy.tgz
+RUN tar xzf snappy.tgz
+RUN cd snappy-1.1.3 && \
+    ./autogen.sh && \
+    ./configure && \
+    make install
 
 CMD git clone https://github.com/apache/orc.git -b master && \
   mkdir orc/build && \
diff --git a/docker/debian8/Dockerfile b/docker/debian8/Dockerfile
index 504d3a2e0b..68a7b24348 100644
--- a/docker/debian8/Dockerfile
+++ b/docker/debian8/Dockerfile
@@ -20,19 +20,36 @@
 FROM debian:8
 MAINTAINER Owen O'Malley <[email protected]>
 
+RUN echo "deb http://ftp.debian.org/debian jessie-backports main" \
+  >> /etc/apt/sources.list
+
 RUN apt-get update
 RUN apt-get install -y \
+  autoconf \
   cmake \
   gcc \
   g++ \
   git \
   libsasl2-dev \
   libssl-dev \
+  libtool \
   make \
   maven \
-  openjdk-7-jdk
+  pkg-config \
+  wget
+RUN apt-get -t jessie-backports install -y openjdk-8-jdk
+RUN update-alternatives --set java \
+  /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
 
 WORKDIR /root
+# install a local build of snappy
+RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz"; \
+  -O snappy.tgz
+RUN tar xzf snappy.tgz
+RUN cd snappy-1.1.3 && \
+    ./autogen.sh && \
+    ./configure && \
+    make install
 
 CMD git clone https://github.com/apache/orc.git -b master && \
   mkdir orc/build && \
diff --git a/docker/debian7/Dockerfile b/docker/debian9/Dockerfile
similarity index 90%
rename from docker/debian7/Dockerfile
rename to docker/debian9/Dockerfile
index 45f32ba5b7..54f6e599c3 100644
--- a/docker/debian7/Dockerfile
+++ b/docker/debian9/Dockerfile
@@ -14,10 +14,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# ORC compile for Debian 7
+# ORC compile for Debian 9
 #
 
-FROM debian:7
+FROM debian:9
 MAINTAINER Owen O'Malley <[email protected]>
 
 RUN apt-get update
@@ -26,14 +26,16 @@ RUN apt-get install -y \
   gcc \
   g++ \
   git \
+  libsasl2-dev \
+  libssl-dev \
+  openjdk-8-jdk \
   make \
-  maven \
-  openjdk-7-jdk
+  maven
 
 WORKDIR /root
 
 CMD git clone https://github.com/apache/orc.git -b master && \
   mkdir orc/build && \
   cd orc/build && \
-  cmake .. && \ 
+  cmake .. && \
   make package test-out
diff --git a/docker/os-list.txt b/docker/os-list.txt
new file mode 100644
index 0000000000..7d38a3457a
--- /dev/null
+++ b/docker/os-list.txt
@@ -0,0 +1,7 @@
+centos6
+centos7
+debian8
+debian9
+ubuntu14
+ubuntu16
+ubuntu18
diff --git a/docker/ubuntu12/Dockerfile b/docker/reinit.sh
old mode 100644
new mode 100755
similarity index 67%
rename from docker/ubuntu12/Dockerfile
rename to docker/reinit.sh
index e424018899..24e697c856
--- a/docker/ubuntu12/Dockerfile
+++ b/docker/reinit.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -14,26 +15,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# ORC compile for Ubuntu 12
-#
-
-FROM ubuntu:12.04
-MAINTAINER Owen O'Malley <[email protected]>
-
-RUN apt-get update
-RUN apt-get install -y \
-  cmake \
-  gcc \
-  g++ \
-  git \
-  make \
-  maven \
-  openjdk-7-jdk
-
-WORKDIR /root
-
-CMD git clone https://github.com/apache/orc.git -b master && \
-  mkdir orc/build && \
-  cd orc/build && \
-  cmake .. && \ 
-  make package test-out
+start=`date`
+for os in `cat os-list.txt`; do
+  echo "Re-initialize $os"
+  ( cd $os && docker build --no-cache -t "orc-$os" . )
+done
+echo "Start: $start"
+echo "End:" `date`
diff --git a/docker/run-all.sh b/docker/run-all.sh
index 2341130b7a..c781e9bcfb 100755
--- a/docker/run-all.sh
+++ b/docker/run-all.sh
@@ -19,11 +19,39 @@ GITHUB_USER=$1
 URL=https://github.com/$GITHUB_USER/orc.git
 BRANCH=$2
 
+CLONE="git clone $URL -b $BRANCH"
+MAKEDIR="mkdir orc/build && cd orc/build"
+mkdir -p logs
+
 start=`date`
-for os in centos6 centos7 debian7 debian8 ubuntu12 ubuntu14 ubuntu16; do
+for os in `cat os-list.txt`; do
+  echo "Building $os"
+  ( cd $os && docker build -t "orc-$os" . ) > logs/$os-build.log 2>&1 || exit 1
+done
+testStart=`date`
+
+for os in `cat os-list.txt`; do
   echo "Testing $os"
-  ( cd $os && docker build -t "orc-$os" . )
-  docker run "orc-$os" /bin/bash -c "git clone $URL -b $BRANCH && mkdir 
orc/build && cd orc/build && cmake .. && make package test-out" || exit 1
+  case $os in
+  centos6|ubuntu12)
+     OPTS="-DSNAPPY_HOME=/usr/local -DPROTOBUF_HOME=/usr/local"
+     ;;
+  centos7|debian8|ubuntu14)
+     OPTS="-DSNAPPY_HOME=/usr/local"
+     ;;
+  debian9)
+     # there is a bug in debian 9 that causes surefire to fail
+     OPTS="-DBUILD_JAVA=OFF"
+     ;;
+  *)
+     OPTS=""
+     ;;
+  esac
+  docker run "orc-$os" /bin/bash -c \
+        "$CLONE && $MAKEDIR && cmake $OPTS .. && make package test-out" \
+         > logs/$os-test.log 2>&1 || exit 1
 done
-echo "Start: $start"
+
+echo "Build start: $start"
+echo "Test start: $testStart"
 echo "End:" `date`
diff --git a/docker/ubuntu14/Dockerfile b/docker/ubuntu14/Dockerfile
index 4f25b26ecc..6cf29af97c 100644
--- a/docker/ubuntu14/Dockerfile
+++ b/docker/ubuntu14/Dockerfile
@@ -20,19 +20,34 @@
 FROM ubuntu:14.04
 MAINTAINER Owen O'Malley <[email protected]>
 
+RUN apt-get update
+RUN apt-get install -y software-properties-common
+RUN add-apt-repository -y ppa:openjdk-r/ppa
 RUN apt-get update
 RUN apt-get install -y \
+  autoconf \
   cmake \
   gcc \
   g++ \
   git \
   libsasl2-dev \
   libssl-dev \
+  libtool \
   make \
   maven \
-  openjdk-7-jdk
+  openjdk-8-jdk \
+  pkg-config \
+  wget
 
 WORKDIR /root
+# install a local build of snappy
+RUN wget "https://github.com/google/snappy/archive/1.1.3.tar.gz"; \
+  -O snappy.tgz
+RUN tar xzf snappy.tgz
+RUN cd snappy-1.1.3 && \
+    ./autogen.sh && \
+    ./configure && \
+    make install
 
 CMD git clone https://github.com/apache/orc.git -b master && \
   mkdir orc/build && \
diff --git a/java/core/src/test/org/apache/orc/TestColumnStatistics.java 
b/java/core/src/test/org/apache/orc/TestColumnStatistics.java
index 30e310c1b6..e6d6953815 100644
--- a/java/core/src/test/org/apache/orc/TestColumnStatistics.java
+++ b/java/core/src/test/org/apache/orc/TestColumnStatistics.java
@@ -136,8 +136,9 @@ public void testUpperAndLowerBounds() throws Exception {
     final StringColumnStatistics typed = (StringColumnStatistics) stats1;
     final StringColumnStatistics typed2 = (StringColumnStatistics) stats2;
 
-    assertTrue("Upperbound cannot be more than 1024 bytes",1024 >= 
typed.getUpperBound().getBytes().length);
-    assertTrue("Lowerbound cannot be more than 1024 bytes",1024 >= 
typed.getLowerBound().getBytes().length);
+    assertTrue("Upperbound cannot be more than 1024 bytes",
+        1024 >= typed.getUpperBound().getBytes(StandardCharsets.UTF_8).length);
+    assertTrue("Lowerbound cannot be more than 1024 bytes",1024 >= 
typed.getLowerBound().getBytes(StandardCharsets.UTF_8).length);
 
     assertEquals(null, typed.getMinimum());
     assertEquals(null, typed.getMaximum());
@@ -145,10 +146,11 @@ public void testUpperAndLowerBounds() throws Exception {
     stats1.reset();
 
     /* test a scenario for the first max bytes */
-    stats1.updateString(test.getBytes(), 0, test.getBytes().length, 0);
+    stats1.updateString(test.getBytes(StandardCharsets.UTF_8), 0,
+        test.getBytes(StandardCharsets.UTF_8).length, 0);
 
-    assertTrue("Lowerbound cannot be more than 1024 bytes", 1024 >= 
typed.getLowerBound().getBytes().length);
-    assertTrue("Upperbound cannot be more than 1024 bytes", 1024 >= 
typed.getUpperBound().getBytes().length);
+    assertTrue("Lowerbound cannot be more than 1024 bytes", 1024 >= 
typed.getLowerBound().getBytes(StandardCharsets.UTF_8).length);
+    assertTrue("Upperbound cannot be more than 1024 bytes", 1024 >= 
typed.getUpperBound().getBytes(StandardCharsets.UTF_8).length);
 
     assertEquals(null, typed.getMinimum());
     assertEquals(null, typed.getMaximum());
diff --git a/java/core/src/test/org/apache/orc/TestUnicode.java 
b/java/core/src/test/org/apache/orc/TestUnicode.java
index 45565a0bfd..45cbb58460 100644
--- a/java/core/src/test/org/apache/orc/TestUnicode.java
+++ b/java/core/src/test/org/apache/orc/TestUnicode.java
@@ -20,6 +20,7 @@
 import static org.junit.Assert.assertEquals;
 
 import java.io.File;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -171,7 +172,7 @@ public void verifyWrittenStrings(TypeDescription schema, 
String[] inputs, String
         writer.addRowBatch(batch);
         batch.reset();
       }
-      col.setVal(batch.size++, inputs[i].getBytes());
+      col.setVal(batch.size++, inputs[i].getBytes(StandardCharsets.UTF_8));
     }
     writer.addRowBatch(batch);
     writer.close();
@@ -185,10 +186,21 @@ public void verifyWrittenStrings(TypeDescription schema, 
String[] inputs, String
     while (rows.nextBatch(batch)) {
       for (int r = 0; r < batch.size; ++r) {
         assertEquals(String.format("test for %s:%d", schema, maxLength), 
expected[idx],
-            col.toString(r));
+            toString(col, r));
         idx++;
       }
     }
     fs.delete(testFilePath, false);
   }
+
+  static String toString(BytesColumnVector vector, int row) {
+    if (vector.isRepeating) {
+      row = 0;
+    }
+    if (!vector.noNulls && vector.isNull[row]) {
+      return null;
+    }
+    return new String(vector.vector[row], vector.start[row], 
vector.length[row],
+        StandardCharsets.UTF_8);
+  }
 }
diff --git a/tools/src/CSVFileImport.cc b/tools/src/CSVFileImport.cc
index a08a655f58..c81487996c 100644
--- a/tools/src/CSVFileImport.cc
+++ b/tools/src/CSVFileImport.cc
@@ -46,7 +46,7 @@ std::string extractColumn(std::string s, uint64_t colIndex) {
 
 static const char* GetDate(void) {
   static char buf[200];
-  time_t t = time(nullptr);
+  time_t t = time(ORC_NULLPTR);
   struct tm* p = localtime(&t);
   strftime(buf, sizeof(buf), "[%Y-%m-%d %H:%M:%S]", p);
   return buf;
@@ -246,7 +246,7 @@ void fillTimestampValues(const std::vector<std::string>& 
data,
     } else {
       memset(&timeStruct, 0, sizeof(timeStruct));
       char *left=strptime(col.c_str(), "%Y-%m-%d %H:%M:%S", &timeStruct);
-      if (left == nullptr) {
+      if (left == ORC_NULLPTR) {
        batch->notNull[i] = 0;
       } else {
        batch->notNull[i] = 1;
@@ -453,13 +453,13 @@ int main(int argc, char* argv[]) {
       }
 
       struct timeval t_start, t_end;
-      gettimeofday(&t_start, nullptr);
+      gettimeofday(&t_start, ORC_NULLPTR);
       clock_t c_start = clock();
 
       writer->add(*rowBatch);
 
       totalCPUTime += (clock() - c_start);
-      gettimeofday(&t_end, nullptr);
+      gettimeofday(&t_end, ORC_NULLPTR);
       totalElapsedTime +=
         (static_cast<double>(t_end.tv_sec - t_start.tv_sec) * 1000000.0
           + static_cast<double>(t_end.tv_usec - t_start.tv_usec)) / 1000000.0;
@@ -467,13 +467,13 @@ int main(int argc, char* argv[]) {
   }
 
   struct timeval t_start, t_end;
-  gettimeofday(&t_start, nullptr);
+  gettimeofday(&t_start, ORC_NULLPTR);
   clock_t c_start = clock();
 
   writer->close();
 
   totalCPUTime += (clock() - c_start);
-  gettimeofday(&t_end, nullptr);
+  gettimeofday(&t_end, ORC_NULLPTR);
   totalElapsedTime +=
     (static_cast<double>(t_end.tv_sec - t_start.tv_sec) * 1000000.0
      + static_cast<double>(t_end.tv_usec - t_start.tv_usec)) / 1000000.0;
diff --git a/tools/src/FileMemory.cc b/tools/src/FileMemory.cc
index cc5cdaabe0..2ce9aba1dd 100644
--- a/tools/src/FileMemory.cc
+++ b/tools/src/FileMemory.cc
@@ -33,7 +33,7 @@ class TestMemoryPool: public orc::MemoryPool {
   uint64_t maxMemory;
 
 public:
-  char* malloc(uint64_t size) override {
+  char* malloc(uint64_t size) ORC_OVERRIDE {
     char* p = static_cast<char*>(std::malloc(size));
     blocks[p] = size ;
     totalMemory += size;
@@ -43,7 +43,7 @@ class TestMemoryPool: public orc::MemoryPool {
     return p;
   }
 
-  void free(char* p) override {
+  void free(char* p) ORC_OVERRIDE {
     std::free(p);
     totalMemory -= blocks[p] ;
     blocks.erase(p);
@@ -54,7 +54,7 @@ class TestMemoryPool: public orc::MemoryPool {
   }
 
   TestMemoryPool(): totalMemory(0), maxMemory(0) {}
-  ~TestMemoryPool() override;
+  ~TestMemoryPool() ORC_OVERRIDE;
 };
 
 TestMemoryPool::~TestMemoryPool() {}
diff --git a/tools/test/TestFileStatistics.cc b/tools/test/TestFileStatistics.cc
index a297233a1d..f08b1637c7 100644
--- a/tools/test/TestFileStatistics.cc
+++ b/tools/test/TestFileStatistics.cc
@@ -183,8 +183,11 @@ TEST (TestFileStatistics, testOptions) {
 
   std::string output;
   std::string error;
-
-  EXPECT_EQ(0, runProgram({pgm, "-i", file}, output, error));
+  std::vector<std::string> args;
+  args.push_back(pgm);
+  args.push_back("-i");
+  args.push_back(file);
+  EXPECT_EQ(0, runProgram(args, output, error));
   EXPECT_EQ(expected, output);
   EXPECT_EQ("", error);
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Add docker scripts and update website for debian 9 and ubuntu 18
> ----------------------------------------------------------------
>
>                 Key: ORC-423
>                 URL: https://issues.apache.org/jira/browse/ORC-423
>             Project: ORC
>          Issue Type: Bug
>          Components: build, site
>            Reporter: Owen O'Malley
>            Assignee: Owen O'Malley
>            Priority: Major
>
> We should add docker build scripts for the new versions of debian and ubuntu.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to