OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InputMetadata.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 
17 #pragma once
18 
19 #include <unordered_map>
20 
23 #include "Shared/DbObjectKeys.h"
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 
36 };
37 
39  public:
40  InputTableInfoCache(Executor* executor);
41 
43 
44  void clear();
45 
46  private:
47  std::unordered_map<shared::TableKey, 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 shared::TableKey& table_key, 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);
shared::TableKey table_key
Definition: InputMetadata.h:34
Fragmenter_Namespace::TableInfo info
Definition: InputMetadata.h:35
ChunkMetadataMap synthesize_metadata(const ResultSet *rows)
Executor * executor_
Definition: InputMetadata.h:48
size_t get_frag_count_of_table(const shared::TableKey &table_key, Executor *executor)
Fragmenter_Namespace::TableInfo build_table_info(const std::vector< const TableDescriptor * > &shard_tables)
std::map< int, std::shared_ptr< ChunkMetadata >> ChunkMetadataMap
tuple rows
Definition: report.py:114
std::unordered_map< int, const ResultSetPtr & > TemporaryTables
Definition: InputMetadata.h:31
Executor(const ExecutorId id, Data_Namespace::DataMgr *data_mgr, 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:272
Fragmenter_Namespace::TableInfo getTableInfo(const shared::TableKey &table_key)
InputTableInfoCache(Executor *executor)
std::unordered_map< shared::TableKey, Fragmenter_Namespace::TableInfo > cache_
Definition: InputMetadata.h:47
std::vector< InputTableInfo > get_table_infos(const std::vector< InputDescriptor > &input_descs, Executor *executor)
Execution unit for relational algebra. It&#39;s a low-level description of any relational algebra operati...