OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ForeignTableSchema.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 <cstdint>
20 #include <list>
21 #include <memory>
22 #include <vector>
23 #include "Catalog/CatalogFwd.h"
24 
25 namespace foreign_storage {
27  public:
28  ForeignTableSchema(const int32_t db_id, const ForeignTable* foreign_table);
29 
33  const ColumnDescriptor* getColumnDescriptor(const int column_id) const;
34 
40  const ColumnDescriptor* getLogicalColumn(const int column_id) const;
41 
46  int getParquetColumnIndex(const int column_id) const;
47 
51  const std::list<const ColumnDescriptor*>& getLogicalAndPhysicalColumns() const;
52 
56  int numLogicalAndPhysicalColumns() const;
57 
61  const std::list<const ColumnDescriptor*>& getLogicalColumns() const;
62 
66  int numLogicalColumns() const;
67 
68  const ForeignTable* getForeignTable() const;
69 
70  private:
71  std::vector<int>::const_iterator getLogicalColumnIdIterator(const int column_id) const;
72 
73  std::list<const ColumnDescriptor*> logical_and_physical_columns_;
74  std::list<const ColumnDescriptor*> logical_columns_;
75  std::vector<int> logical_column_ids_;
77  std::shared_ptr<Catalog_Namespace::Catalog> catalog_;
78 };
79 } // namespace foreign_storage
std::list< const ColumnDescriptor * > logical_and_physical_columns_
int getParquetColumnIndex(const int column_id) const
const ForeignTable * getForeignTable() const
ForeignTableSchema(const int32_t db_id, const ForeignTable *foreign_table)
specifies the content in-memory of a row in the column metadata table
const std::list< const ColumnDescriptor * > & getLogicalAndPhysicalColumns() const
std::shared_ptr< Catalog_Namespace::Catalog > catalog_
const std::list< const ColumnDescriptor * > & getLogicalColumns() const
const ColumnDescriptor * getLogicalColumn(const int column_id) const
std::list< const ColumnDescriptor * > logical_columns_
std::vector< int >::const_iterator getLogicalColumnIdIterator(const int column_id) const
const ColumnDescriptor * getColumnDescriptor(const int column_id) const