OmniSciDB  a7179b2938
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ForeignDataWrapperShared.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 OmniSci, 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 <stdexcept>
20 
21 namespace foreign_storage {
22 inline void throw_removed_row_error(const std::string& file_path) {
23  throw std::runtime_error{
24  "Refresh of foreign table created with \"APPEND\" update type failed as file "
25  "reduced in size: " +
26  file_path};
27 }
28 
29 inline void throw_removed_file_error(const std::string& file_path) {
30  throw std::runtime_error{
31  "Refresh of foreign table created with \"APPEND\" update type failed as "
32  "file \"" +
33  file_path + "\" was removed."};
34 }
35 inline void throw_number_of_columns_mismatch_error(size_t num_table_cols,
36  size_t num_file_cols,
37  const std::string& file_path) {
38  throw std::runtime_error{"Mismatched number of logical columns: (expected " +
39  std::to_string(num_table_cols) + " columns, has " +
40  std::to_string(num_file_cols) + "): in file '" + file_path +
41  "'"};
42 }
43 } // namespace foreign_storage
std::string to_string(char const *&&v)
void throw_removed_row_error(const std::string &file_path)
void throw_removed_file_error(const std::string &file_path)
void throw_number_of_columns_mismatch_error(size_t num_table_cols, size_t num_file_cols, const std::string &file_path)