From 95fefcf6e48f94f5bf350a3a31a119350b0e03c5 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sun, 18 Sep 2016 13:01:00 -0400 Subject: [PATCH] PARQUET-720: Mark ScanAllValues as inline to prevent link error Closes #161 Author: Uwe L. Korn Author: fscheibner Closes #163 from xhochy/PARQUET-720 and squashes the following commits: 4d3125d [Uwe L. Korn] Add ScanAllValues to parquet namespace b2c9ff1 [Uwe L. Korn] Format fixes 8f91550 [fscheibner] Move ScanAllValues to scan-all.cc 60dec35 [fscheibner] Mark ScanAllValues as inline to prevent link error Change-Id: Ide0c58ae3c5622a615c3732f72709c7ca37453dc --- cpp/src/parquet/column/scan-all.cc | 56 ++++++++++++++++++++++++++++++ cpp/src/parquet/column/scan-all.h | 40 ++++----------------- 2 files changed, 63 insertions(+), 33 deletions(-) create mode 100644 cpp/src/parquet/column/scan-all.cc diff --git a/cpp/src/parquet/column/scan-all.cc b/cpp/src/parquet/column/scan-all.cc new file mode 100644 index 0000000000000..36a7689958214 --- /dev/null +++ b/cpp/src/parquet/column/scan-all.cc @@ -0,0 +1,56 @@ +// 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 "parquet/column/scan-all.h" + +namespace parquet { + +int64_t ScanAllValues(int32_t batch_size, int16_t* def_levels, int16_t* rep_levels, + uint8_t* values, int64_t* values_buffered, parquet::ColumnReader* reader) { + switch (reader->type()) { + case parquet::Type::BOOLEAN: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::INT32: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::INT64: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::INT96: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::FLOAT: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::DOUBLE: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::BYTE_ARRAY: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + case parquet::Type::FIXED_LEN_BYTE_ARRAY: + return ScanAll( + batch_size, def_levels, rep_levels, values, values_buffered, reader); + default: + parquet::ParquetException::NYI("type reader not implemented"); + } + // Unreachable code, but supress compiler warning + return 0; +} + +} // namespace parquet diff --git a/cpp/src/parquet/column/scan-all.h b/cpp/src/parquet/column/scan-all.h index fd63bffe30a19..b701c17b7580f 100644 --- a/cpp/src/parquet/column/scan-all.h +++ b/cpp/src/parquet/column/scan-all.h @@ -20,6 +20,8 @@ #include "parquet/column/reader.h" +namespace parquet { + template int64_t ScanAll(int32_t batch_size, int16_t* def_levels, int16_t* rep_levels, uint8_t* values, int64_t* values_buffered, parquet::ColumnReader* reader) { @@ -30,38 +32,10 @@ int64_t ScanAll(int32_t batch_size, int16_t* def_levels, int16_t* rep_levels, batch_size, def_levels, rep_levels, vals, values_buffered); } -int64_t ScanAllValues(int32_t batch_size, int16_t* def_levels, int16_t* rep_levels, - uint8_t* values, int64_t* values_buffered, parquet::ColumnReader* reader) { - switch (reader->type()) { - case parquet::Type::BOOLEAN: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::INT32: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::INT64: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::INT96: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::FLOAT: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::DOUBLE: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::BYTE_ARRAY: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - case parquet::Type::FIXED_LEN_BYTE_ARRAY: - return ScanAll( - batch_size, def_levels, rep_levels, values, values_buffered, reader); - default: - parquet::ParquetException::NYI("type reader not implemented"); - } - // Unreachable code, but supress compiler warning - return 0; -} +int64_t PARQUET_EXPORT ScanAllValues(int32_t batch_size, int16_t* def_levels, + int16_t* rep_levels, uint8_t* values, int64_t* values_buffered, + parquet::ColumnReader* reader); + +} // namespace parquet #endif // PARQUET_SCAN_ALL_H