OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OutputBufferInitialization.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 QUERYENGINE_OUTPUTBUFFERINITIALIZATION_H
24 #define QUERYENGINE_OUTPUTBUFFERINITIALIZATION_H
25 
26 #include "Shared/SqlTypesLayout.h"
27 
28 #include <list>
29 #include <memory>
30 #include <utility>
31 #include <vector>
32 
33 namespace Analyzer {
34 class Expr;
35 } // namespace Analyzer
36 
38 
39 std::pair<int64_t, int64_t> inline_int_max_min(const size_t byte_width);
40 
41 std::pair<uint64_t, uint64_t> inline_uint_max_min(const size_t byte_width);
42 
43 int64_t get_agg_initial_val(const SQLAgg agg,
44  const SQLTypeInfo& ti,
45  const bool enable_compaction,
46  const unsigned min_byte_width_to_compact);
47 
48 std::vector<int64_t> init_agg_val_vec(
49  const std::vector<Analyzer::Expr*>& targets,
50  const std::list<std::shared_ptr<Analyzer::Expr>>& quals,
52 
53 std::vector<int64_t> init_agg_val_vec(const std::vector<TargetInfo>& targets,
55 
56 const Analyzer::Expr* agg_arg(const Analyzer::Expr* expr);
57 
58 bool constrained_not_null(const Analyzer::Expr* expr,
59  const std::list<std::shared_ptr<Analyzer::Expr>>& quals);
60 
61 void set_notnull(TargetInfo& target, const bool not_null);
62 
63 #endif // QUERYENGINE_OUTPUTBUFFERINITIALIZATION_H
const Analyzer::Expr * agg_arg(const Analyzer::Expr *expr)
SQLAgg
Definition: sqldefs.h:73
bool constrained_not_null(const Analyzer::Expr *expr, const std::list< std::shared_ptr< Analyzer::Expr >> &quals)
int64_t get_agg_initial_val(const SQLAgg agg, const SQLTypeInfo &ti, const bool enable_compaction, const unsigned min_byte_width_to_compact)
std::pair< uint64_t, uint64_t > inline_uint_max_min(const size_t byte_width)
std::pair< int64_t, int64_t > inline_int_max_min(const size_t byte_width)
std::vector< int64_t > init_agg_val_vec(const std::vector< TargetInfo > &targets, const QueryMemoryDescriptor &query_mem_desc)
void set_notnull(TargetInfo &target, const bool not_null)