Error 10: NOT_FOUND_COLUMN_IN_BLOCK
This error occurs when ClickHouse attempts to access a column that doesn't exist in a data block during query execution, merge operations, or mutations. It typically indicates schema inconsistency between table metadata and actual data parts.
Most common causes
-
Schema Evolution Issues with Mutations
- Mutations fail when trying to process parts that were created before certain columns were added to the table
- Parts with different data versions have different column sets
- Missing internal columns like
_block_numberduring DELETE mutations
-
ALTER TABLEOperations Gone Wrong- Column additions/modifications not properly applied to all parts
- Incomplete mutations that leave some parts with old schema
-
Missing Internal Columns
_block_numbercolumn missing duringDELETEmutations (very common case)- Virtual columns expected but not present in older data parts
-
Projection-Related Issues
- Materialized projections referencing columns that don't exist in older parts
- Projection calculations failing when columns are missing from source data
Common solutions
1. Kill and Retry the Mutation
2. Force Part Merges
This can help consolidate parts with different schemas.
3. Check Part Versions
Look for parts with very old data versions that might be missing columns.
4. Verify Column Presence Across Parts
- Old parts created before column additions may be missing columns
- Use
clickhouse-diskutility to inspect actual column metadata in parts
5. For Missing _block_number Errors
This is a known issue with DELETE mutations on tables with older parts. Solutions:
- Kill the mutation and retry
- Consider using lightweight deletes if available in your version
- Upgrade to newer ClickHouse versions where this is fixed
6. For Projection Errors
If the error occurs during projection materialization:
Prevention tips
- Plan Schema Changes Carefully: Understand that all existing parts need to be processed when adding columns used in mutations
- Monitor Mutation Queue: Regularly check
system.mutationsfor stuck operations - Use Proper
ALTERSyntax: EnsureALTER TABLEoperations complete successfully - Keep ClickHouse Updated: Many of these issues are fixed in newer versions
- Regular
OPTIMIZEOperations: Help consolidate parts and maintain schema consistency
If you're experiencing this error, it is recommended to:
- Check
system.mutationsto identify the stuck mutation - Examine part versions to find schema inconsistencies
- Kill and retry the mutation as a first step
- If it persists, consider escalating to ClickHouse support with specific details about your table schema and the failing operation