OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InputMetadata.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 
17 #ifndef QUERYENGINE_INPUTMETADATA_H
18 #define QUERYENGINE_INPUTMETADATA_H
19 
22 
23 #include <unordered_map>
24 
25 namespace Catalog_Namespace {
26 class Catalog;
27 } // namespace Catalog_Namespace
28 
29 class Executor;
30 
31 using TemporaryTables = std::unordered_map<int, const ResultSetPtr&>;
32 
34  int table_id;
36 };
37 
39  public:
40  InputTableInfoCache(Executor* executor);
41 
43 
44  void clear();
45 
46  private:
47  std::unordered_map<int, Fragmenter_Namespace::TableInfo> cache_;
48  Executor* executor_;
49 };
50 
51 ChunkMetadataMap synthesize_metadata(const ResultSet* rows);
52 
53 size_t get_frag_count_of_table(const int table_id, Executor* executor);
54 
55 std::vector<InputTableInfo> get_table_infos(
56  const std::vector<InputDescriptor>& input_descs,
57  Executor* executor);
58 
59 std::vector<InputTableInfo> get_table_infos(const RelAlgExecutionUnit& ra_exe_unit,
60  Executor* executor);
61 
63  const std::vector<const TableDescriptor*>& shard_tables);
64 
65 #endif // QUERYENGINE_INPUTMETADATA_H
Fragmenter_Namespace::TableInfo info
Definition: InputMetadata.h:35
ChunkMetadataMap synthesize_metadata(const ResultSet *rows)
Executor * executor_
Definition: InputMetadata.h:48
Fragmenter_Namespace::TableInfo build_table_info(const std::vector< const TableDescriptor * > &shard_tables)
std::map< int, std::shared_ptr< ChunkMetadata >> ChunkMetadataMap
std::unordered_map< int, const ResultSetPtr & > TemporaryTables
Definition: InputMetadata.h:31
Fragmenter_Namespace::TableInfo getTableInfo(const int table_id)
InputTableInfoCache(Executor *executor)
std::vector< InputTableInfo > get_table_infos(const std::vector< InputDescriptor > &input_descs, Executor *executor)
Executor(const ExecutorId id, const size_t block_size_x, const size_t grid_size_x, const size_t max_gpu_slab_size, const std::string &debug_dir, const std::string &debug_file)
Definition: Execute.cpp:144
Execution unit for relational algebra. It&#39;s a low-level description of any relational algebra operati...
std::unordered_map< int, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47
size_t get_frag_count_of_table(const int table_id, Executor *executor)