OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CsvFileBufferParser.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 
20 
21 namespace foreign_storage {
23  public:
25  bool convert_data_blocks,
26  bool columns_are_pre_filtered = false) const override;
27 
29  const ForeignTable* foreign_table) const override;
30 
31  size_t findRowEndPosition(size_t& alloc_size,
32  std::unique_ptr<char[]>& buffer,
33  size_t& buffer_size,
34  const import_export::CopyParams& copy_params,
35  const size_t buffer_first_row_index,
36  unsigned int& num_rows_in_buffer,
37  foreign_storage::FileReader* file_reader) const override;
38 
39  void validateExpectedColumnCount(const std::string& row,
40  const import_export::CopyParams& copy_params,
41  size_t num_cols,
42  int point_cols,
43  const std::string& file_name) const;
44 
45  void validateFiles(const FileReader* file_reader,
46  const ForeignTable* foreign_table) const override{};
47 
48  // @TODO(se) more?
49  inline static const std::string DELIMITER_KEY = "DELIMITER";
50  inline static const std::string NULLS_KEY = "NULLS";
51  inline static const std::string HEADER_KEY = "HEADER";
52  inline static const std::string QUOTED_KEY = "QUOTED";
53  inline static const std::string QUOTE_KEY = "QUOTE";
54  inline static const std::string ESCAPE_KEY = "ESCAPE";
55  inline static const std::string LINE_DELIMITER_KEY = "LINE_DELIMITER";
56  inline static const std::string ARRAY_DELIMITER_KEY = "ARRAY_DELIMITER";
57  inline static const std::string ARRAY_MARKER_KEY = "ARRAY_MARKER";
58  inline static const std::string LONLAT_KEY = "LONLAT";
59  inline static const std::string GEO_ASSIGN_RENDER_GROUPS_KEY =
60  "GEO_ASSIGN_RENDER_GROUPS";
61  inline static const std::string GEO_EXPLODE_COLLECTIONS_KEY = "GEO_EXPLODE_COLLECTIONS";
62  inline static const std::string SOURCE_SRID_KEY = "SOURCE_SRID";
63  inline static const std::string TRIM_SPACES_KEY = "TRIM_SPACES";
64 };
65 } // namespace foreign_storage
static const std::string GEO_EXPLODE_COLLECTIONS_KEY
static const std::string TRIM_SPACES_KEY
static const std::string ARRAY_MARKER_KEY
ParseBufferResult parseBuffer(ParseBufferRequest &request, bool convert_data_blocks, bool columns_are_pre_filtered=false) const override
static const std::string SOURCE_SRID_KEY
static const std::string LINE_DELIMITER_KEY
size_t findRowEndPosition(size_t &alloc_size, std::unique_ptr< char[]> &buffer, size_t &buffer_size, const import_export::CopyParams &copy_params, const size_t buffer_first_row_index, unsigned int &num_rows_in_buffer, foreign_storage::FileReader *file_reader) const override
static const std::string DELIMITER_KEY
import_export::CopyParams validateAndGetCopyParams(const ForeignTable *foreign_table) const override
static const std::string ARRAY_DELIMITER_KEY
void validateExpectedColumnCount(const std::string &row, const import_export::CopyParams &copy_params, size_t num_cols, int point_cols, const std::string &file_name) const
void validateFiles(const FileReader *file_reader, const ForeignTable *foreign_table) const override
static const std::string GEO_ASSIGN_RENDER_GROUPS_KEY