MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / prepareReader

Method prepareReader

src/Processors/Formats/Impl/ORCBlockInputFormat.cpp:131–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void ORCBlockInputFormat::prepareReader()
132{
133 std::shared_ptr<arrow::Schema> schema;
134 getFileReaderAndSchema(*in, file_reader, schema, format_settings, is_stopped);
135 if (is_stopped)
136 return;
137
138 stripe_total = static_cast<int>(file_reader->NumberOfStripes());
139 stripe_current = 0;
140
141 arrow_column_to_ch_column = std::make_unique<ArrowColumnToCHColumn>(
142 getPort().getHeader(),
143 "ORC",
144 format_settings,
145 std::nullopt,
146 std::nullopt,
147 format_settings.orc.allow_missing_columns,
148 format_settings.null_as_default,
149 format_settings.date_time_overflow_behavior,
150 format_settings.parquet.allow_geoparquet_parser,
151 format_settings.orc.case_insensitive_column_matching);
152
153 const bool ignore_case = format_settings.orc.case_insensitive_column_matching;
154 std::unordered_set<String> nested_table_names = Nested::getAllTableNames(getPort().getHeader(), ignore_case);
155 for (int i = 0; i < schema->num_fields(); ++i)
156 {
157 const auto & name = schema->field(i)->name();
158 if (getPort().getHeader().has(name, ignore_case) || nested_table_names.contains(ignore_case ? boost::to_lower_copy(name) : name))
159 include_indices.push_back(i);
160 }
161}
162
163ORCSchemaReader::ORCSchemaReader(ReadBuffer & in_, const FormatSettings & format_settings_)
164 : ISchemaReader(in_), format_settings(format_settings_)

Callers

nothing calls this directly

Calls 7

getFileReaderAndSchemaFunction · 0.85
getAllTableNamesFunction · 0.85
getHeaderMethod · 0.45
nameMethod · 0.45
hasMethod · 0.45
containsMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected