Skip to content

Commit

Permalink
PARQUET-720: Mark ScanAllValues as inline to prevent link error
Browse files Browse the repository at this point in the history
Closes apache#161

Author: Uwe L. Korn <[email protected]>
Author: fscheibner <[email protected]>

Closes apache#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
  • Loading branch information
xhochy authored and wesm committed Sep 18, 2016
1 parent 9e46b37 commit b8de4d0
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 33 deletions.
56 changes: 56 additions & 0 deletions cpp/src/parquet/column/scan-all.cc
Original file line number Diff line number Diff line change
@@ -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<parquet::BoolReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::INT32:
return ScanAll<parquet::Int32Reader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::INT64:
return ScanAll<parquet::Int64Reader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::INT96:
return ScanAll<parquet::Int96Reader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::FLOAT:
return ScanAll<parquet::FloatReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::DOUBLE:
return ScanAll<parquet::DoubleReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::BYTE_ARRAY:
return ScanAll<parquet::ByteArrayReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::FIXED_LEN_BYTE_ARRAY:
return ScanAll<parquet::FixedLenByteArrayReader>(
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
40 changes: 7 additions & 33 deletions cpp/src/parquet/column/scan-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include "parquet/column/reader.h"

namespace parquet {

template <typename RType>
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) {
Expand All @@ -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<parquet::BoolReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::INT32:
return ScanAll<parquet::Int32Reader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::INT64:
return ScanAll<parquet::Int64Reader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::INT96:
return ScanAll<parquet::Int96Reader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::FLOAT:
return ScanAll<parquet::FloatReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::DOUBLE:
return ScanAll<parquet::DoubleReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::BYTE_ARRAY:
return ScanAll<parquet::ByteArrayReader>(
batch_size, def_levels, rep_levels, values, values_buffered, reader);
case parquet::Type::FIXED_LEN_BYTE_ARRAY:
return ScanAll<parquet::FixedLenByteArrayReader>(
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

0 comments on commit b8de4d0

Please sign in to comment.