58.25% (3971/6817) Uncovered changed code (with context): ================================================================================ src/Columns/ColumnDynamic.cpp ================================================================================ --- uncovered block 296-297 --- 294 | if (!addNewVariant(type, type_name)) 295 | { >> 296 | insertValueIntoSharedVariant(src, type, type_name, n); >> 297 | return; 298 | } 299 | ================================================================================ src/DataTypes/IDataType.cpp ================================================================================ --- uncovered block 281-284 --- 279 | if (const auto * column_const = checkAndGetColumn(column.get())) 280 | { >> 281 | auto subcolumn = tryGetSubcolumn(subcolumn_name, column_const->getDataColumnPtr()); >> 282 | if (!subcolumn) >> 283 | return nullptr; >> 284 | return ColumnConst::create(subcolumn, column_const->size()); 285 | } 286 | --- uncovered block 295-295 --- 293 | { 294 | if (const auto * column_const = checkAndGetColumn(column.get())) >> 295 | return ColumnConst::create(getSubcolumn(subcolumn_name, column_const->getDataColumnPtr()), column_const->size()); 296 | 297 | auto data = SubstreamData(getSerialization(*getSerializationInfo(*column))).withType(getPtr()).withColumn(column); ================================================================================ src/DataTypes/Serializations/SerializationDynamicElement.cpp ================================================================================ --- uncovered block 247-249 --- 245 | if (is_low_cardinality_nullable) 246 | { >> 247 | auto tmp_column = requested_type->createColumn(); >> 248 | variant_serialization->deserializeBinary(*tmp_column, buf, format_settings); >> 249 | non_nullable_variant_column->insertFrom(*tmp_column, 0); 250 | } 251 | else if (is_null_map_subcolumn) ================================================================================ src/DataTypes/Serializations/SerializationDynamicHelpers.cpp ================================================================================ --- uncovered block 33-33 --- 31 | { 32 | if (lhs.getSchemaFormat() != rhs.getSchemaFormat()) >> 33 | return false; 34 | 35 | if (lhs.getTypedPaths().size() != rhs.getTypedPaths().size()) --- uncovered block 36-36 --- 34 | 35 | if (lhs.getTypedPaths().size() != rhs.getTypedPaths().size()) >> 36 | return false; 37 | 38 | for (const auto & [path, lhs_type] : lhs.getTypedPaths()) --- uncovered block 40-42 --- 38 | for (const auto & [path, lhs_type] : lhs.getTypedPaths()) 39 | { >> 40 | auto it = rhs.getTypedPaths().find(path); >> 41 | if (it == rhs.getTypedPaths().end() || !areDynamicSubcolumnTypesCompatible(lhs_type, it->second)) >> 42 | return false; 43 | } 44 | --- uncovered block 68-68 --- 66 | { 67 | if (const auto * rhs_nullable = typeid_cast(&rhs)) >> 68 | return areDynamicSubcolumnTypesCompatible(lhs_nullable->getNestedType(), rhs_nullable->getNestedType()); 69 | } 70 | --- uncovered block 74-74 --- 72 | { 73 | if (const auto * rhs_low_cardinality = typeid_cast(&rhs)) >> 74 | return areDynamicSubcolumnTypesCompatible(lhs_low_cardinality->getDictionaryType(), rhs_low_cardinality->getDictionaryType()); 75 | } 76 | --- uncovered block 83-84 --- 81 | return false; 82 | >> 83 | if (lhs_tuple->getElementNames() != rhs_tuple->getElementNames()) >> 84 | return false; 85 | 86 | const auto & lhs_elements = lhs_tuple->getElements(); --- uncovered block 86-89 --- 84 | return false; 85 | >> 86 | const auto & lhs_elements = lhs_tuple->getElements(); >> 87 | const auto & rhs_elements = rhs_tuple->getElements(); >> 88 | if (lhs_elements.size() != rhs_elements.size()) >> 89 | return false; 90 | 91 | for (size_t i = 0; i != lhs_elements.size(); ++i) --- uncovered block 91-91 --- 89 | return false; 90 | >> 91 | for (size_t i = 0; i != lhs_elements.size(); ++i) 92 | { 93 | if (!areDynamicSubcolumnTypesCompatible(lhs_elements[i], rhs_elements[i])) --- uncovered block 93-94 --- 91 | for (size_t i = 0; i != lhs_elements.size(); ++i) 92 | { >> 93 | if (!areDynamicSubcolumnTypesCompatible(lhs_elements[i], rhs_elements[i])) >> 94 | return false; 95 | } 96 | --- uncovered block 97-97 --- 95 | } 96 | >> 97 | return true; 98 | } 99 | ================================================================================ src/Processors/Formats/Impl/Parquet/Decoding.cpp ================================================================================ --- uncovered block 85-85 --- 83 | size_t pass_count = 0; 84 | for (size_t i = 0; i < num_values; ++i) >> 85 | pass_count += filter[filter_offset + i]; 86 | 87 | if (pass_count == 0) --- uncovered block 89-90 --- 87 | if (pass_count == 0) 88 | { >> 89 | skip(num_values); >> 90 | return; 91 | } 92 | --- uncovered block 203-203 --- 201 | void decodeFiltered(size_t num_values, T * out, const UInt8 * filter, size_t filter_offset) 202 | { >> 203 | if (bit_width == 0) 204 | { 205 | for (size_t i = 0; i < num_values; ++i) --- uncovered block 205-205 --- 203 | if (bit_width == 0) 204 | { >> 205 | for (size_t i = 0; i < num_values; ++i) 206 | { 207 | if (filter[filter_offset + i]) --- uncovered block 207-207 --- 205 | for (size_t i = 0; i < num_values; ++i) 206 | { >> 207 | if (filter[filter_offset + i]) 208 | { 209 | *out = 0; --- uncovered block 209-210 --- 207 | if (filter[filter_offset + i]) 208 | { >> 209 | *out = 0; >> 210 | ++out; 211 | } 212 | } --- uncovered block 214-214 --- 212 | } 213 | >> 214 | return; 215 | } 216 | --- uncovered block 217-218 --- 215 | } 216 | >> 217 | const T value_mask = T((1ul << bit_width) - 1); >> 218 | size_t filter_pos = filter_offset; 219 | 220 | while (num_values) --- uncovered block 220-220 --- 218 | size_t filter_pos = filter_offset; 219 | >> 220 | while (num_values) 221 | { 222 | if (run_length == 0) --- uncovered block 222-223 --- 220 | while (num_values) 221 | { >> 222 | if (run_length == 0) >> 223 | startRun(); 224 | 225 | size_t n = std::min(run_length, num_values); --- uncovered block 225-227 --- 223 | startRun(); 224 | >> 225 | size_t n = std::min(run_length, num_values); >> 226 | run_length -= n; >> 227 | num_values -= n; 228 | 229 | if (run_is_rle) --- uncovered block 229-229 --- 227 | num_values -= n; 228 | >> 229 | if (run_is_rle) 230 | { 231 | const T v = val; --- uncovered block 231-232 --- 229 | if (run_is_rle) 230 | { >> 231 | const T v = val; >> 232 | for (size_t i = 0; i < n; ++i) 233 | { 234 | if (filter[filter_pos + i]) --- uncovered block 234-234 --- 232 | for (size_t i = 0; i < n; ++i) 233 | { >> 234 | if (filter[filter_pos + i]) 235 | { 236 | *out = v; --- uncovered block 236-237 --- 234 | if (filter[filter_pos + i]) 235 | { >> 236 | *out = v; >> 237 | ++out; 238 | } 239 | } --- uncovered block 243-243 --- 241 | else 242 | { >> 243 | for (size_t i = 0; i < n; ++i) 244 | { 245 | size_t x; --- uncovered block 245-247 --- 243 | for (size_t i = 0; i < n; ++i) 244 | { >> 245 | size_t x; >> 246 | memcpy(&x, data + (bit_idx >> 3), 8); >> 247 | x = (x >> (bit_idx & 7)) & value_mask; 248 | 249 | if (x >= limit) --- uncovered block 249-250 --- 247 | x = (x >> (bit_idx & 7)) & value_mask; 248 | >> 249 | if (x >= limit) >> 250 | throw Exception(ErrorCodes::INCORRECT_DATA, "Dict index or rep/def level out of bounds (bp)"); 251 | 252 | if (filter[filter_pos + i]) --- uncovered block 252-252 --- 250 | throw Exception(ErrorCodes::INCORRECT_DATA, "Dict index or rep/def level out of bounds (bp)"); 251 | >> 252 | if (filter[filter_pos + i]) 253 | { 254 | *out = static_cast(x); --- uncovered block 254-255 --- 252 | if (filter[filter_pos + i]) 253 | { >> 254 | *out = static_cast(x); >> 255 | ++out; 256 | } 257 | --- uncovered block 258-258 --- 256 | } 257 | >> 258 | bit_idx += bit_width; 259 | } 260 | --- uncovered block 261-262 --- 259 | } 260 | >> 261 | if (!run_length) >> 262 | data += run_bytes; 263 | } 264 | --- uncovered block 265-265 --- 263 | } 264 | >> 265 | filter_pos += n; 266 | } 267 | } --- uncovered block 1410-1413 --- 1408 | out.insertRangeFromDictionaryEncodedColumn(*col, indexes_col); 1409 | break; >> 1410 | case Mode::FixedSize: >> 1411 | case Mode::Uninitialized: >> 1412 | chassert(false); >> 1413 | break; 1414 | } 1415 | } ================================================================================ src/Processors/Formats/Impl/Parquet/PrepareForWrite.cpp ================================================================================ --- uncovered block 97-97 --- 95 | { 96 | if (!child.children.empty()) >> 97 | return false; 98 | 99 | child.value_type = type; --- uncovered block 104-104 --- 102 | 103 | if (child.value_type) >> 104 | return false; 105 | 106 | return insertDeclaredVariantObjectPath(child, tail, type); --- uncovered block 117-117 --- 115 | 116 | if (root.value_type) >> 117 | return nullptr; 118 | 119 | DataTypes field_types; --- uncovered block 125-125 --- 123 | DataTypePtr child_type = buildDeclaredVariantObjectType(child_node); 124 | if (!child_type) >> 125 | continue; 126 | 127 | field_names.push_back(field_name); --- uncovered block 132-132 --- 130 | 131 | if (field_types.empty()) >> 132 | return nullptr; 133 | 134 | return std::make_shared(field_types, field_names); --- uncovered block 148-150 --- 146 | if (const auto * array_type = typeid_cast(normalized_type.get())) 147 | { >> 148 | DataTypePtr child_type = getDeclaredVariantShreddedTypeForParquetWriteImpl(array_type->getNestedType()); >> 149 | if (!child_type) >> 150 | return nullptr; 151 | 152 | return std::make_shared(makeVariantWrappedTypedValueType(child_type)); --- uncovered block 152-152 --- 150 | return nullptr; 151 | >> 152 | return std::make_shared(makeVariantWrappedTypedValueType(child_type)); 153 | } 154 | --- uncovered block 157-158 --- 155 | if (const auto * tuple_type = typeid_cast(normalized_type.get())) 156 | { >> 157 | if (!tuple_type->hasExplicitNames()) >> 158 | return nullptr; 159 | 160 | DataTypes field_types; --- uncovered block 160-162 --- 158 | return nullptr; 159 | >> 160 | DataTypes field_types; >> 161 | Names field_names; >> 162 | for (size_t i = 0; i < tuple_type->getElements().size(); ++i) 163 | { 164 | DataTypePtr child_type = getDeclaredVariantShreddedTypeForParquetWriteImpl(tuple_type->getElement(i)); --- uncovered block 164-166 --- 162 | for (size_t i = 0; i < tuple_type->getElements().size(); ++i) 163 | { >> 164 | DataTypePtr child_type = getDeclaredVariantShreddedTypeForParquetWriteImpl(tuple_type->getElement(i)); >> 165 | if (!child_type) >> 166 | continue; 167 | 168 | field_names.push_back(tuple_type->getNameByPosition(i + 1)); --- uncovered block 168-169 --- 166 | continue; 167 | >> 168 | field_names.push_back(tuple_type->getNameByPosition(i + 1)); >> 169 | field_types.push_back(makeVariantWrappedTypedValueType(child_type)); 170 | } 171 | --- uncovered block 172-173 --- 170 | } 171 | >> 172 | if (field_types.empty()) >> 173 | return nullptr; 174 | 175 | return std::make_shared(field_types, field_names); --- uncovered block 175-175 --- 173 | return nullptr; 174 | >> 175 | return std::make_shared(field_types, field_names); 176 | } 177 | --- uncovered block 181-181 --- 179 | { 180 | if (object_type->getSchemaFormat() != DataTypeObject::SchemaFormat::JSON) >> 181 | return nullptr; 182 | 183 | DeclaredVariantObjectNode root; --- uncovered block 187-187 --- 185 | { 186 | if (!insertDeclaredVariantObjectPath(root, path, path_type)) >> 187 | return nullptr; 188 | } 189 | --- uncovered block 194-194 --- 192 | 193 | if (typeid_cast(normalized_type.get())) >> 194 | return nullptr; 195 | 196 | return normalized_type; --- uncovered block 659-660 --- 657 | if (inferred_shredded_type) 658 | { >> 659 | shredded_type = inferred_shredded_type; >> 660 | (*out_variant_type_hints)[path] = shredded_type; 661 | } 662 | --- uncovered block 668-668 --- 666 | root_schema.__set_num_children(shredded_type ? 3 : 2); 667 | if (field_id) >> 668 | root_schema.__set_field_id(static_cast(*field_id)); 669 | 670 | parq::VariantType variant_type; --- uncovered block 787-788 --- 785 | for (size_t i = child_states_begin; i < states.size(); ++i) 786 | { >> 787 | Strings & state_schema_path = states[i].column_chunk.meta_data.path_in_schema; >> 788 | state_schema_path.insert(state_schema_path.begin(), schema.name + "."); 789 | } 790 | } --- uncovered block 796-798 --- 794 | if (schemas[child_schema_idx].name == "nullable") 795 | { >> 796 | String nullable_schema_path = appendParquetPath(schema_path, "nullable"); >> 797 | String child_prefix = schema_path + '\x1f'; >> 798 | for (const auto & nested_path : nested_variant_wrapper_paths) 799 | { 800 | if (nested_path == schema_path) --- uncovered block 800-800 --- 798 | for (const auto & nested_path : nested_variant_wrapper_paths) 799 | { >> 800 | if (nested_path == schema_path) 801 | { 802 | out_variant_wrapper_paths->insert(nullable_schema_path); --- uncovered block 802-803 --- 800 | if (nested_path == schema_path) 801 | { >> 802 | out_variant_wrapper_paths->insert(nullable_schema_path); >> 803 | continue; 804 | } 805 | --- uncovered block 806-807 --- 804 | } 805 | >> 806 | if (nested_path.starts_with(child_prefix)) >> 807 | out_variant_wrapper_paths->insert(nullable_schema_path + nested_path.substr(schema_path.size())); 808 | } 809 | } --- uncovered block 1083-1083 --- 1081 | switch (type->getTypeId()) 1082 | { >> 1083 | case TypeIndex::Nullable: 1084 | { 1085 | const auto * column_nullable = assert_cast(column.get()); --- uncovered block 1085-1088 --- 1083 | case TypeIndex::Nullable: 1084 | { >> 1085 | const auto * column_nullable = assert_cast(column.get()); >> 1086 | auto nested_type = assert_cast(*type).getNestedType(); >> 1087 | analyzeVariantColumnTypesRecursive(column_nullable->getNestedColumnPtr(), nested_type, options, format_settings, out_variant_analysis, path); >> 1088 | break; 1089 | } 1090 | case TypeIndex::Array: --- uncovered block 1090-1090 --- 1088 | break; 1089 | } >> 1090 | case TypeIndex::Array: 1091 | { 1092 | const auto * column_array = assert_cast(column.get()); --- uncovered block 1092-1095 --- 1090 | case TypeIndex::Array: 1091 | { >> 1092 | const auto * column_array = assert_cast(column.get()); >> 1093 | auto nested_type = assert_cast(*type).getNestedType(); >> 1094 | analyzeVariantColumnTypesRecursive(column_array->getDataPtr(), nested_type, options, format_settings, out_variant_analysis, appendParquetPath(path, "element")); >> 1095 | break; 1096 | } 1097 | case TypeIndex::Tuple: --- uncovered block 1097-1097 --- 1095 | break; 1096 | } >> 1097 | case TypeIndex::Tuple: 1098 | { 1099 | const auto * column_tuple = assert_cast(column.get()); --- uncovered block 1099-1101 --- 1097 | case TypeIndex::Tuple: 1098 | { >> 1099 | const auto * column_tuple = assert_cast(column.get()); >> 1100 | const auto * type_tuple = assert_cast(type.get()); >> 1101 | for (size_t i = 0; i < type_tuple->getElements().size(); ++i) 1102 | { 1103 | analyzeVariantColumnTypesRecursive( --- uncovered block 1103-1109 --- 1101 | for (size_t i = 0; i < type_tuple->getElements().size(); ++i) 1102 | { >> 1103 | analyzeVariantColumnTypesRecursive( >> 1104 | column_tuple->getColumnPtr(i), >> 1105 | type_tuple->getElement(i), >> 1106 | options, >> 1107 | format_settings, >> 1108 | out_variant_analysis, >> 1109 | appendParquetPath(path, type_tuple->getNameByPosition(i + 1))); 1110 | } 1111 | break; --- uncovered block 1111-1111 --- 1109 | appendParquetPath(path, type_tuple->getNameByPosition(i + 1))); 1110 | } >> 1111 | break; 1112 | } 1113 | case TypeIndex::Map: --- uncovered block 1113-1113 --- 1111 | break; 1112 | } >> 1113 | case TypeIndex::Map: 1114 | { 1115 | const auto * column_map = assert_cast(column.get()); --- uncovered block 1115-1125 --- 1113 | case TypeIndex::Map: 1114 | { >> 1115 | const auto * column_map = assert_cast(column.get()); >> 1116 | const auto * map_type = assert_cast(type.get()); >> 1117 | DataTypePtr tuple_type = std::make_shared(map_type->getKeyValueTypes(), Strings{"key", "value"}); >> 1118 | analyzeVariantColumnTypesRecursive( >> 1119 | column_map->getNestedColumn().getDataPtr(), >> 1120 | tuple_type, >> 1121 | options, >> 1122 | format_settings, >> 1123 | out_variant_analysis, >> 1124 | appendParquetPath(path, "key_value")); >> 1125 | break; 1126 | } 1127 | case TypeIndex::Object: --- uncovered block 1137-1137 --- 1135 | analyzeVariantColumnForWrite(*column, type, format_settings, out_variant_analysis[path]); 1136 | break; >> 1137 | case TypeIndex::LowCardinality: 1138 | { 1139 | auto nested_type = assert_cast(*type).getDictionaryType(); --- uncovered block 1139-1141 --- 1137 | case TypeIndex::LowCardinality: 1138 | { >> 1139 | auto nested_type = assert_cast(*type).getDictionaryType(); >> 1140 | analyzeVariantColumnTypesRecursive(column->convertToFullColumnIfLowCardinality(), nested_type, options, format_settings, out_variant_analysis, path); >> 1141 | break; 1142 | } 1143 | default: --- uncovered block 1159-1159 --- 1157 | DataTypePtr normalized_type = unwrapVariantTypeHint(type); 1158 | if (!normalized_type) >> 1159 | return false; 1160 | 1161 | if (typeid_cast(normalized_type.get())) --- uncovered block 1175-1175 --- 1173 | { 1174 | if (variantWriteRequiresFileLevelAnalysis(path_type, output_json_as_variant)) >> 1175 | return true; 1176 | } 1177 | --- uncovered block 1189-1189 --- 1187 | { 1188 | if (variantWriteRequiresFileLevelAnalysis(element, output_json_as_variant)) >> 1189 | return true; 1190 | } 1191 | ================================================================================ src/Processors/Formats/Impl/Parquet/ReadManager.cpp ================================================================================ --- uncovered block 664-664 --- 662 | /// (all row groups reached Deallocated before shutdown was called). 663 | /// - In abnormal destruction (~ReadManager), nobody checks the counter. >> 664 | return; 665 | runBatchOfTasks(_batch); 666 | }; ================================================================================ src/Processors/Formats/Impl/Parquet/Reader.cpp ================================================================================ --- uncovered block 371-371 --- 369 | if (output_info.source_idx >= variant_sources.size()) 370 | { >> 371 | throw Exception( 372 | ErrorCodes::LOGICAL_ERROR, 373 | "Invalid `Parquet` `VARIANT` source index {} while initializing output {}", --- uncovered block 373-375 --- 371 | throw Exception( 372 | ErrorCodes::LOGICAL_ERROR, >> 373 | "Invalid `Parquet` `VARIANT` source index {} while initializing output {}", >> 374 | output_info.source_idx, >> 375 | output_info.name); 376 | } 377 | --- uncovered block 381-381 --- 379 | if (state_idx >= variant_source_output_counts.size()) 380 | { >> 381 | throw Exception( 382 | ErrorCodes::LOGICAL_ERROR, 383 | "Invalid `Parquet` `VARIANT` state slot {} while initializing output {}", --- uncovered block 383-385 --- 381 | throw Exception( 382 | ErrorCodes::LOGICAL_ERROR, >> 383 | "Invalid `Parquet` `VARIANT` state slot {} while initializing output {}", >> 384 | state_idx, >> 385 | output_info.name); 386 | } 387 | --- uncovered block 731-731 --- 729 | auto idx_in_output_block = extended_sample_block.findPositionByName(required_column.name); 730 | if (!idx_in_output_block.has_value()) >> 731 | continue; 732 | 733 | const auto & output_idx = sample_block_to_output_columns_idx.at(*idx_in_output_block); --- uncovered block 735-735 --- 733 | const auto & output_idx = sample_block_to_output_columns_idx.at(*idx_in_output_block); 734 | if (!output_idx.has_value()) >> 735 | continue; 736 | 737 | const auto & output_info = output_columns.at(*output_idx); --- uncovered block 741-741 --- 739 | continue; 740 | >> 741 | return true; 742 | } 743 | --- uncovered block 832-832 --- 830 | auto idx_in_output_block = extended_sample_block.findPositionByName(required_column.name); 831 | if (!idx_in_output_block.has_value()) >> 832 | continue; 833 | 834 | const auto & output_idx = sample_block_to_output_columns_idx.at(*idx_in_output_block); --- uncovered block 836-836 --- 834 | const auto & output_idx = sample_block_to_output_columns_idx.at(*idx_in_output_block); 835 | if (!output_idx.has_value()) >> 836 | continue; 837 | 838 | const auto & output_info = output_columns.at(*output_idx); --- uncovered block 841-842 --- 839 | if (output_info.source_kind == OutputColumnInfo::SourceKind::Variant && !output_info.source_subcolumn_name.empty()) 840 | { >> 841 | uses_variant_subcolumns = true; >> 842 | break; 843 | } 844 | } --- uncovered block 873-873 --- 871 | if (defer_prewhere_execution && format_filter_info->prewhere_info) 872 | { >> 873 | for (const auto * node : format_filter_info->prewhere_info->prewhere_actions.getOutputs()) 874 | { 875 | auto idx = extended_sample_block.findPositionByName(node->result_name); --- uncovered block 875-877 --- 873 | for (const auto * node : format_filter_info->prewhere_info->prewhere_actions.getOutputs()) 874 | { >> 875 | auto idx = extended_sample_block.findPositionByName(node->result_name); >> 876 | if (idx.has_value() && !sample_block_to_output_columns_idx.at(*idx).has_value()) >> 877 | prewhere_output_column_idxs.insert(*idx); 878 | } 879 | } --- uncovered block 1434-1434 --- 1432 | if (memchr(null_map.data(), 1, null_map.size()) != nullptr) 1433 | throw Exception(ErrorCodes::CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN, "Cannot convert NULL value to non-Nullable type for column {}", column_info.name); >> 1434 | subchunk.null_map = nullptr; 1435 | } 1436 | --- uncovered block 1459-1459 --- 1457 | 1458 | if (column_info.dependent_output_idxs_in_block.empty()) >> 1459 | return; 1460 | 1461 | for (size_t idx_in_output_block : column_info.dependent_output_idxs_in_block) --- uncovered block 1603-1603 --- 1601 | const auto & data = assert_cast(*offsets).getData(); 1602 | if (data[-1] != 0) >> 1603 | throw Exception(ErrorCodes::INCORRECT_DATA, "Invalid repetition/definition levels for arrays in column {}", column_info.name); 1604 | } 1605 | --- uncovered block 2165-2165 --- 2163 | if (auto * low_cardinality_column = typeid_cast(subchunk.column.get())) 2164 | { >> 2165 | if (!column_info.low_cardinality_dictionary_type) 2166 | throw Exception(ErrorCodes::LOGICAL_ERROR, "Missing dictionary type for `LowCardinality` `Parquet` column {}", column_info.name); 2167 | --- uncovered block 2168-2171 --- 2166 | throw Exception(ErrorCodes::LOGICAL_ERROR, "Missing dictionary type for `LowCardinality` `Parquet` column {}", column_info.name); 2167 | >> 2168 | auto full_column = column_info.low_cardinality_dictionary_type->createColumn(); >> 2169 | full_column->reserve(encoded_values_to_read); >> 2170 | page.decoder->decode(encoded_values_to_read, *full_column, filter, filter_offset); >> 2171 | low_cardinality_column->insertRangeFromFullColumn(*full_column, 0, full_column->size()); 2172 | } 2173 | else --- uncovered block 2199-2199 --- 2197 | return; 2198 | if (output_info.source_idx >= variant_sources.size()) >> 2199 | return; 2200 | 2201 | const auto & source_info = variant_sources[output_info.source_idx]; --- uncovered block 2204-2204 --- 2202 | const size_t shared_state_idx = source_info.state_slot_idx; 2203 | if (shared_state_idx >= row_subgroup.variant_outputs_remaining.size()) >> 2204 | return; 2205 | 2206 | size_t & remaining_outputs = row_subgroup.variant_outputs_remaining[shared_state_idx]; --- uncovered block 2210-2210 --- 2208 | --remaining_outputs; 2209 | if (remaining_outputs != 0) >> 2210 | return; 2211 | 2212 | if (source_info.value_primitive_idx != UINT64_MAX && source_info.value_primitive_idx < row_subgroup.columns.size()) --- uncovered block 2226-2226 --- 2224 | if (output_column_idx >= row_subgroup.formed_output_columns.size()) 2225 | { >> 2226 | throw Exception( 2227 | ErrorCodes::LOGICAL_ERROR, 2228 | "Invalid cached output index {} while caching `Parquet` output; only {} cached outputs are available", --- uncovered block 2228-2230 --- 2226 | throw Exception( 2227 | ErrorCodes::LOGICAL_ERROR, >> 2228 | "Invalid cached output index {} while caching `Parquet` output; only {} cached outputs are available", >> 2229 | output_column_idx, >> 2230 | row_subgroup.formed_output_columns.size()); 2231 | } 2232 | --- uncovered block 2236-2236 --- 2234 | ColumnPtr & cached_output = row_subgroup.formed_output_columns[output_column_idx]; 2235 | if (cached_output) >> 2236 | return; 2237 | 2238 | cached_output = column; --- uncovered block 2244-2244 --- 2242 | if (*output_info.idx_in_output_block >= row_subgroup.output.size()) 2243 | { >> 2244 | throw Exception( 2245 | ErrorCodes::LOGICAL_ERROR, 2246 | "Invalid output slot {} while caching `Parquet` output {} of type {}; only {} output slots are available", --- uncovered block 2246-2250 --- 2244 | throw Exception( 2245 | ErrorCodes::LOGICAL_ERROR, >> 2246 | "Invalid output slot {} while caching `Parquet` output {} of type {}; only {} output slots are available", >> 2247 | *output_info.idx_in_output_block, >> 2248 | output_info.name, >> 2249 | output_info.input_type->getName(), >> 2250 | row_subgroup.output.size()); 2251 | } 2252 | --- uncovered block 2265-2265 --- 2263 | if (output_column_idx >= row_subgroup.formed_output_columns.size()) 2264 | { >> 2265 | throw Exception( 2266 | ErrorCodes::LOGICAL_ERROR, 2267 | "Invalid cached output index {} while forming `Parquet` output; only {} cached outputs are available", --- uncovered block 2267-2269 --- 2265 | throw Exception( 2266 | ErrorCodes::LOGICAL_ERROR, >> 2267 | "Invalid cached output index {} while forming `Parquet` output; only {} cached outputs are available", >> 2268 | output_column_idx, >> 2269 | row_subgroup.formed_output_columns.size()); 2270 | } 2271 | --- uncovered block 2287-2287 --- 2285 | if (*output_info.idx_in_output_block >= row_subgroup.output.size()) 2286 | { >> 2287 | throw Exception( 2288 | ErrorCodes::LOGICAL_ERROR, 2289 | "Invalid output slot {} while reusing `Parquet` output {} of type {}; only {} output slots are available", --- uncovered block 2289-2293 --- 2287 | throw Exception( 2288 | ErrorCodes::LOGICAL_ERROR, >> 2289 | "Invalid output slot {} while reusing `Parquet` output {} of type {}; only {} output slots are available", >> 2290 | *output_info.idx_in_output_block, >> 2291 | output_info.name, >> 2292 | output_info.input_type->getName(), >> 2293 | row_subgroup.output.size()); 2294 | } 2295 | --- uncovered block 2299-2300 --- 2297 | if (state.column) 2298 | { >> 2299 | cached_output = state.column; >> 2300 | return IColumn::mutate(cached_output); 2301 | } 2302 | } === Lost Baseline Coverage: 25 lines === ================================================================================ src/Formats/FormatFilterInfo.cpp ================================================================================ --- lost coverage block 109-109 --- 107 | { 108 | if (!keys.has(col.name) && !additional_columns.has(col.name)) >> 109 | additional_columns.insert({col.type->createColumn(), col.type, col.name}); 110 | } 111 | }; ================================================================================ src/Processors/Formats/Impl/Parquet/Decoding.cpp ================================================================================ --- lost coverage block 792-792 --- 790 | return; 791 | } >> 792 | if (converter->isTrivial()) 793 | { 794 | auto & col_str = assert_cast(col); --- lost coverage block 807-810 --- 805 | else 806 | { >> 807 | PaddedPODArray chars_buf; >> 808 | IColumn::Offsets out_offsets; >> 809 | size_t num_pass = 0; >> 810 | for (size_t i = 0; i < num_values; ++i) 811 | num_pass += filter[filter_offset + i]; 812 | if (num_pass == 0) --- lost coverage block 812-812 --- 810 | for (size_t i = 0; i < num_values; ++i) 811 | num_pass += filter[filter_offset + i]; >> 812 | if (num_pass == 0) 813 | { 814 | idx += num_values; --- lost coverage block 817-819 --- 815 | return; 816 | } >> 817 | const UInt64 * off = offsets.data() + idx; >> 818 | size_t prev = idx ? off[-1] : 0; >> 819 | for (size_t i = 0; i < num_values; ++i) 820 | { 821 | size_t len = off[i] - prev; --- lost coverage block 830-830 --- 828 | prev = off[i]; 829 | } >> 830 | converter->convertColumn(std::span(chars_buf.data(), chars_buf.size()), out_offsets.data(), /*separator_bytes*/ 0, num_pass, col); 831 | } 832 | idx += num_values; --- lost coverage block 832-832 --- 830 | converter->convertColumn(std::span(chars_buf.data(), chars_buf.size()), out_offsets.data(), /*separator_bytes*/ 0, num_pass, col); 831 | } >> 832 | idx += num_values; 833 | } 834 | }; ================================================================================ src/Processors/Formats/Impl/Parquet/Reader.cpp ================================================================================ --- lost coverage block 2515-2515 --- 2513 | "`Parquet` output {} was requested before all primitive dependencies were decoded ({} remaining)", 2514 | extended_sample_block.getByPosition(idx_in_output_block).name, >> 2515 | state.primitive_columns_remaining.load()); 2516 | } 2517 | if (output_idx.has_value()) ================================================================================ src/Processors/Formats/Impl/Parquet/SchemaConverter.cpp ================================================================================ --- lost coverage block 888-888 --- 886 | low_cardinality_dictionary_type = primitive_decoded_type; 887 | if (primitive_output_nullable) >> 888 | low_cardinality_dictionary_type = std::make_shared(low_cardinality_dictionary_type); 889 | 890 | primitive_column_type = std::make_shared(low_cardinality_dictionary_type); --- lost coverage block 992-992 --- 990 | { 991 | if (isPrimitiveNode(*node.element)) >> 992 | return false; 993 | 994 | /// Only recognize VARIANT columns with an explicit logical type annotation. --- lost coverage block 1858-1858 --- 1856 | physical_bits = 64; 1857 | else >> 1858 | throw Exception(ErrorCodes::INCORRECT_DATA, "Unexpected non-int physical type for int logical type: {}", thriftToString(element)); 1859 | 1860 | bits = std::min(bits, physical_bits); ================================================================================ src/Processors/Transforms/FilterTransform.cpp ================================================================================ --- lost coverage block 297-297 --- 295 | 296 | if (options.return_filter && result.rows_after != result.rows_before) >> 297 | result.filter = materializeFilter(*filter_description); 298 | 299 | /// If the current block is completely filtered out, let's move on to the next one. ================================================================================ src/Storages/StorageURL.cpp ================================================================================ --- lost coverage block 614-614 --- 612 | /// If all options are unreachable except empty ones that we skipped, 613 | /// return last empty result. It will be skipped later. >> 614 | if (last_skipped_empty_res.second) 615 | return last_skipped_empty_res; 616 | --- lost coverage block 617-617 --- 615 | return last_skipped_empty_res; 616 | >> 617 | throw Exception(ErrorCodes::NETWORK_ERROR, "All uri ({}) options are unreachable: {}", options, first_exception_message); 618 | } 619 | ================================================================================ src/Storages/prepareReadingFromFormat.cpp ================================================================================ --- lost coverage block 348-348 --- 346 | size_t prefix_len = i + 1; 347 | if (prefix_len <= column_info.path.size()) >> 348 | continue; 349 | 350 | auto name = ISerialization::getSubcolumnNameForStream(subpath, prefix_len); --- lost coverage block 431-432 --- 429 | if (it != name_to_idx.end()) 430 | { >> 431 | const auto & ancestor_info = columns_info[it->second]; >> 432 | const auto & ancestor_type_in_storage = ancestor_name == column_to_read.name ? column_to_read.type : ancestor_info.type; 433 | column_to_read.setDelimiterAndTypeInStorage(ancestor_name, ancestor_type_in_storage); 434 | ancestor_requested = true; --- lost coverage block 434-435 --- 432 | const auto & ancestor_type_in_storage = ancestor_name == column_to_read.name ? column_to_read.type : ancestor_info.type; 433 | column_to_read.setDelimiterAndTypeInStorage(ancestor_name, ancestor_type_in_storage); >> 434 | ancestor_requested = true; >> 435 | break; 436 | } 437 | } --- lost coverage block 439-439 --- 437 | } 438 | if (ancestor_requested) >> 439 | continue; 440 | 441 | const auto & type_in_storage = column_info.name == column_to_read.name ? column_to_read.type : column_info.type; WARNING: Failed to get start time for [Print Uncovered Code] - start time and duration won't be set --- Coverage counts --- Lines : baseline 759,681/903,280 -> current 763,983/911,501 (delta +4,302 / +8,221) Functions : baseline 830,915/912,038 -> current 831,156/912,638 (delta +241 / +600) Branches : baseline 246,930/322,406 -> current 248,688/326,248 (delta +1,758 / +3,842)