| 129 | } |
| 130 | |
| 131 | void 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 | |
| 163 | ORCSchemaReader::ORCSchemaReader(ReadBuffer & in_, const FormatSettings & format_settings_) |
| 164 | : ISchemaReader(in_), format_settings(format_settings_) |
nothing calls this directly
no test coverage detected