You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by om...@apache.org on 2016/08/04 21:51:10 UTC
[4/4] orc git commit: ORC-85. Update the C++ library with the newer
WriterVersion values. (omalley)
ORC-85. Update the C++ library with the newer WriterVersion values.
(omalley)
Fixes #51.
Signed-off-by: Owen O'Malley <om...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/orc/repo
Commit: http://git-wip-us.apache.org/repos/asf/orc/commit/0481613d
Tree: http://git-wip-us.apache.org/repos/asf/orc/tree/0481613d
Diff: http://git-wip-us.apache.org/repos/asf/orc/diff/0481613d
Branch: refs/heads/master
Commit: 0481613d342796d139a42d32e9e8ed0a8374729f
Parents: 3bad3df
Author: Owen O'Malley <om...@apache.org>
Authored: Thu Aug 4 10:51:58 2016 -0700
Committer: Owen O'Malley <om...@apache.org>
Committed: Thu Aug 4 14:50:31 2016 -0700
----------------------------------------------------------------------
c++/include/orc/Reader.hh | 8 +-
c++/src/Reader.cc | 10 +-
c++/test/CMakeLists.txt | 1 +
c++/test/TestReader.cc | 49 +
tools/test/CMakeLists.txt | 2 +-
tools/test/TestFileMetadata.cc | 4 +-
tools/test/TestMatch.cc | 3148 ++++++++++++++++++++++++++++++++++
tools/test/TestReader.cc | 3169 -----------------------------------
tools/test/ToolTest.cc | 2 +-
tools/test/ToolTest.hh | 2 -
10 files changed, 3215 insertions(+), 3180 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/orc/blob/0481613d/c++/include/orc/Reader.hh
----------------------------------------------------------------------
diff --git a/c++/include/orc/Reader.hh b/c++/include/orc/Reader.hh
index fd2e708..14d4d3c 100644
--- a/c++/include/orc/Reader.hh
+++ b/c++/include/orc/Reader.hh
@@ -38,7 +38,8 @@ namespace orc {
CompressionKind_SNAPPY = 2,
CompressionKind_LZO = 3,
CompressionKind_LZ4 = 4,
- CompressionKind_ZSTD = 5
+ CompressionKind_ZSTD = 5,
+ CompressionKind_MAX = INT64_MAX
};
/**
@@ -49,7 +50,10 @@ namespace orc {
enum WriterVersion {
WriterVersion_ORIGINAL = 0,
WriterVersion_HIVE_8732 = 1,
- WriterVersion_HIVE_4243 = 2
+ WriterVersion_HIVE_4243 = 2,
+ WriterVersion_HIVE_12055 = 3,
+ WriterVersion_HIVE_13083 = 4,
+ WriterVersion_MAX = INT64_MAX
};
/**
http://git-wip-us.apache.org/repos/asf/orc/blob/0481613d/c++/src/Reader.cc
----------------------------------------------------------------------
diff --git a/c++/src/Reader.cc b/c++/src/Reader.cc
index 62489e7..b3eeb4a 100644
--- a/c++/src/Reader.cc
+++ b/c++/src/Reader.cc
@@ -47,11 +47,11 @@ namespace orc {
case CompressionKind_SNAPPY:
return "snappy";
case CompressionKind_LZO:
- return "LZO";
+ return "lzo";
case CompressionKind_LZ4:
- return "LZ4";
+ return "lz4";
case CompressionKind_ZSTD:
- return "ZSTD";
+ return "zstd";
}
std::stringstream buffer;
buffer << "unknown - " << kind;
@@ -66,6 +66,10 @@ namespace orc {
return "HIVE-8732";
case WriterVersion_HIVE_4243:
return "HIVE-4243";
+ case WriterVersion_HIVE_12055:
+ return "HIVE-12055";
+ case WriterVersion_HIVE_13083:
+ return "HIVE-13083";
}
std::stringstream buffer;
buffer << "future - " << version;
http://git-wip-us.apache.org/repos/asf/orc/blob/0481613d/c++/test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index f2f3845..6b7fd00 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -29,6 +29,7 @@ add_executable (orc-test
TestCompression.cc
TestDriver.cc
TestInt128.cc
+ TestReader.cc
TestRle.cc
TestTimezone.cc
TestType.cc
http://git-wip-us.apache.org/repos/asf/orc/blob/0481613d/c++/test/TestReader.cc
----------------------------------------------------------------------
diff --git a/c++/test/TestReader.cc b/c++/test/TestReader.cc
new file mode 100644
index 0000000..68f6de1
--- /dev/null
+++ b/c++/test/TestReader.cc
@@ -0,0 +1,49 @@
+/**
+ * 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
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "orc/Reader.hh"
+
+#include "Adaptor.hh"
+
+#include "wrap/gmock.h"
+#include "wrap/gtest-wrapper.h"
+
+namespace orc {
+
+ TEST(TestReader, testWriterVersions) {
+ EXPECT_EQ("original", writerVersionToString(WriterVersion_ORIGINAL));
+ EXPECT_EQ("HIVE-8732", writerVersionToString(WriterVersion_HIVE_8732));
+ EXPECT_EQ("HIVE-4243", writerVersionToString(WriterVersion_HIVE_4243));
+ EXPECT_EQ("HIVE-12055", writerVersionToString(WriterVersion_HIVE_12055));
+ EXPECT_EQ("HIVE-13083", writerVersionToString(WriterVersion_HIVE_13083));
+ EXPECT_EQ("future - 99",
+ writerVersionToString(static_cast<WriterVersion>(99)));
+ }
+
+ TEST(TestReader, testCompressionNames) {
+ EXPECT_EQ("none", compressionKindToString(CompressionKind_NONE));
+ EXPECT_EQ("zlib", compressionKindToString(CompressionKind_ZLIB));
+ EXPECT_EQ("snappy", compressionKindToString(CompressionKind_SNAPPY));
+ EXPECT_EQ("lzo", compressionKindToString(CompressionKind_LZO));
+ EXPECT_EQ("lz4", compressionKindToString(CompressionKind_LZ4));
+ EXPECT_EQ("zstd", compressionKindToString(CompressionKind_ZSTD));
+ EXPECT_EQ("unknown - 99",
+ compressionKindToString(static_cast<CompressionKind>(99)));
+ }
+
+} // namespace
http://git-wip-us.apache.org/repos/asf/orc/blob/0481613d/tools/test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt
index 121f7f7..36d9b2f 100644
--- a/tools/test/CMakeLists.txt
+++ b/tools/test/CMakeLists.txt
@@ -25,9 +25,9 @@ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS} ${WARN_FLAGS}")
add_executable (tool-test
gzip.cc
- TestReader.cc
TestFileMetadata.cc
TestFileScan.cc
+ TestMatch.cc
ToolTest.cc
)
http://git-wip-us.apache.org/repos/asf/orc/blob/0481613d/tools/test/TestFileMetadata.cc
----------------------------------------------------------------------
diff --git a/tools/test/TestFileMetadata.cc b/tools/test/TestFileMetadata.cc
index 4b3a341..ec962e5 100644
--- a/tools/test/TestFileMetadata.cc
+++ b/tools/test/TestFileMetadata.cc
@@ -149,11 +149,11 @@ TEST (TestFileMetadata, testRaw) {
std::string output;
std::string error;
- EXPECT_EQ(0, runProgram({pgm, "-r", file}, output, error));
+ EXPECT_EQ(0, runProgram({pgm, std::string("-r"), file}, output, error));
EXPECT_EQ(expected, output);
EXPECT_EQ("", error);
- EXPECT_EQ(0, runProgram({pgm, "--raw", file}, output, error));
+ EXPECT_EQ(0, runProgram({pgm, std::string("--raw"), file}, output, error));
EXPECT_EQ(expected, output);
EXPECT_EQ("", error);
}