OmniSciDB  2e3a973ef4
ParquetEncoder.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
20 #include "DataMgr/AbstractBuffer.h"
21 
22 namespace foreign_storage {
23 
25  public:
27  virtual ~ParquetEncoder() = default;
28 
29  virtual void appendData(const int16_t* def_levels,
30  const int16_t* rep_levels,
31  const int64_t values_read,
32  const int64_t levels_read,
33  const bool is_last_batch,
34  int8_t* values) = 0;
35 
36  protected:
38 };
39 
41  public:
43 
44  virtual void setNull(int8_t* omnisci_data_bytes) = 0;
45  virtual void copy(const int8_t* omnisci_data_bytes_source,
46  int8_t* omnisci_data_bytes_destination) = 0;
47  virtual void encodeAndCopy(const int8_t* parquet_data_bytes,
48  int8_t* omnisci_data_bytes) = 0;
49 
50  virtual void encodeAndCopyContiguous(const int8_t* parquet_data_bytes,
51  int8_t* omnisci_data_bytes,
52  const size_t num_elements) = 0;
53 };
54 
55 } // namespace foreign_storage
ParquetEncoder(Data_Namespace::AbstractBuffer *buffer)
virtual ~ParquetEncoder()=default
virtual void appendData(const int16_t *def_levels, const int16_t *rep_levels, const int64_t values_read, const int64_t levels_read, const bool is_last_batch, int8_t *values)=0
An AbstractBuffer is a unit of data management for a data manager.
ParquetScalarEncoder(Data_Namespace::AbstractBuffer *buffer)
Data_Namespace::AbstractBuffer * buffer_