OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ForeignDataImporter.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 "AbstractImporter.h"
21 #include "CopyParams.h"
22 #include "ParserNode.h"
23 
24 namespace import_export {
25 
27  public:
28  ForeignDataImporter(const std::string& file_path,
29  const CopyParams& copy_params,
30  const TableDescriptor* table);
31 
32  /*
33  * Import data returning the status of the import.
34  */
35  ImportStatus import(const Catalog_Namespace::SessionInfo* session_info) override;
36 
37  static void setDefaultImportPath(const std::string& base_path);
38 
39  // This parameter is publicly exposed for testing purposes only
41 
42  protected:
43  std::unique_ptr<Fragmenter_Namespace::InsertDataLoader::InsertConnector> connector_;
44 
45  private:
46  void finalize(const Catalog_Namespace::SessionInfo& parent_session_info,
47  ImportStatus& import_status,
48  const std::vector<std::pair<const ColumnDescriptor*, StringDictionary*>>&
49  string_dictionaries);
50 
51  void finalize(const Catalog_Namespace::SessionInfo& parent_session_info,
52  ImportStatus& import_status,
53  const int32_t table_id);
54 
55 #ifdef ENABLE_IMPORT_PARQUET
56  ImportStatus importParquet(const Catalog_Namespace::SessionInfo* session_info);
57 #endif
58 
61  const std::string& copy_from_source,
62  const CopyParams& copy_params);
63 
65 
66  std::string copy_from_source_;
69  inline static std::string default_import_path_;
70 };
71 } // namespace import_export
static void setDefaultImportPath(const std::string &base_path)
Classes representing a parse tree.
ForeignDataImporter(const std::string &file_path, const CopyParams &copy_params, const TableDescriptor *table)
std::unique_ptr< Fragmenter_Namespace::InsertDataLoader::InsertConnector > connector_
ImportStatus importGeneralS3(const Catalog_Namespace::SessionInfo *session_info)
void finalize(const Catalog_Namespace::SessionInfo &parent_session_info, ImportStatus &import_status, const std::vector< std::pair< const ColumnDescriptor *, StringDictionary * >> &string_dictionaries)
ImportStatus importGeneral(const Catalog_Namespace::SessionInfo *session_info)