OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChunkIter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 
23 #ifndef _CHUNK_ITER_H_
24 #define _CHUNK_ITER_H_
25 
26 #include "../Shared/funcannotations.h"
27 #include "../Shared/sqltypes.h"
28 
29 class ChunkIter {
30  public:
32  int8_t* second_buf;
33  int8_t* current_pos;
34  int8_t* start_pos;
35  int8_t* end_pos;
36  int skip;
37  int skip_size;
38  size_t num_elems;
39  Datum datum; // used to hold uncompressed value
40 };
41 
42 void ChunkIter_reset(ChunkIter* it);
44  bool uncompress,
45  VarlenDatum* vd,
46  bool* is_end);
47 // @brief get nth element in Chunk. Does not change ChunkIter state
49  int nth,
50  bool uncompress,
51  VarlenDatum* vd,
52  bool* is_end);
53 DEVICE void ChunkIter_get_nth(ChunkIter* it, int nth, ArrayDatum* vd, bool* is_end);
55  int nth,
56  ArrayDatum* vd,
57  bool* is_end);
59  int nth,
60  ArrayDatum* vd,
61  bool* is_end);
63  int nth,
64  ArrayDatum* vd,
65  bool* is_end);
66 #endif // _CHUNK_ITER_H_
int8_t * start_pos
Definition: ChunkIter.h:34
int8_t * current_pos
Definition: ChunkIter.h:33
SQLTypeInfo type_info
Definition: ChunkIter.h:31
Datum datum
Definition: ChunkIter.h:39
DEVICE void ChunkIter_get_nth_point_coords(ChunkIter *it, int n, ArrayDatum *result, bool *is_end)
Definition: ChunkIter.cpp:321
DEVICE void ChunkIter_get_nth(ChunkIter *it, int n, bool uncompress, VarlenDatum *result, bool *is_end)
Definition: ChunkIter.cpp:182
#define DEVICE
std::conditional_t< is_cuda_compiler(), DeviceArrayDatum, HostArrayDatum > ArrayDatum
Definition: sqltypes.h:229
int8_t * end_pos
Definition: ChunkIter.h:35
size_t num_elems
Definition: ChunkIter.h:38
DEVICE void ChunkIter_get_nth_varlen(ChunkIter *it, int n, ArrayDatum *result, bool *is_end)
Definition: ChunkIter.cpp:267
int skip_size
Definition: ChunkIter.h:37
void ChunkIter_reset(ChunkIter *it)
Definition: ChunkIter.cpp:144
int8_t * second_buf
Definition: ChunkIter.h:32
DEVICE void ChunkIter_get_next(ChunkIter *it, bool uncompress, VarlenDatum *result, bool *is_end)
Definition: ChunkIter.cpp:148
int skip
Definition: ChunkIter.h:36
Definition: Datum.h:69
DEVICE void ChunkIter_get_nth_varlen_notnull(ChunkIter *it, int n, ArrayDatum *result, bool *is_end)
Definition: ChunkIter.cpp:301