OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChunkIter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, 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 
22 #ifndef _CHUNK_ITER_H_
23 #define _CHUNK_ITER_H_
24 
25 #include "../Shared/funcannotations.h"
26 #include "../Shared/sqltypes.h"
27 
28 class ChunkIter {
29  public:
31  int8_t* second_buf;
32  int8_t* current_pos;
33  int8_t* start_pos;
34  int8_t* end_pos;
35  int skip;
36  int skip_size;
37  size_t num_elems;
38  Datum datum; // used to hold uncompressed value
39 };
40 
41 void ChunkIter_reset(ChunkIter* it);
43  bool uncompress,
44  VarlenDatum* vd,
45  bool* is_end);
46 // @brief get nth element in Chunk. Does not change ChunkIter state
48  int nth,
49  bool uncompress,
50  VarlenDatum* vd,
51  bool* is_end);
52 DEVICE void ChunkIter_get_nth(ChunkIter* it, int nth, ArrayDatum* vd, bool* is_end);
54  int nth,
55  ArrayDatum* vd,
56  bool* is_end);
58  int nth,
59  ArrayDatum* vd,
60  bool* is_end);
61 
62 #endif // _CHUNK_ITER_H_
int8_t * start_pos
Definition: ChunkIter.h:33
int8_t * current_pos
Definition: ChunkIter.h:32
SQLTypeInfo type_info
Definition: ChunkIter.h:30
Datum datum
Definition: ChunkIter.h:38
DEVICE void ChunkIter_get_nth(ChunkIter *it, int n, bool uncompress, VarlenDatum *result, bool *is_end)
Definition: ChunkIter.cpp:181
#define DEVICE
int8_t * end_pos
Definition: ChunkIter.h:34
size_t num_elems
Definition: ChunkIter.h:37
DEVICE void ChunkIter_get_nth_varlen(ChunkIter *it, int n, ArrayDatum *result, bool *is_end)
Definition: ChunkIter.cpp:258
int skip_size
Definition: ChunkIter.h:36
void ChunkIter_reset(ChunkIter *it)
Definition: ChunkIter.cpp:143
int8_t * second_buf
Definition: ChunkIter.h:31
DEVICE void ChunkIter_get_next(ChunkIter *it, bool uncompress, VarlenDatum *result, bool *is_end)
Definition: ChunkIter.cpp:147
int skip
Definition: ChunkIter.h:35
DEVICE void ChunkIter_get_nth_varlen_notnull(ChunkIter *it, int n, ArrayDatum *result, bool *is_end)
Definition: ChunkIter.cpp:288
std::conditional_t< isCudaCC(), DeviceArrayDatum, HostArrayDatum > ArrayDatum
Definition: sqltypes.h:122