Skip to content

Fix formatting of functions and codecs#83644

Merged
alexey-milovidov merged 10 commits intomasterfrom
fix-formatting-functions-codecs
Jul 17, 2025
Merged

Fix formatting of functions and codecs#83644
alexey-milovidov merged 10 commits intomasterfrom
fix-formatting-functions-codecs

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

User-defined functions with unusual names and codecs can be formatted inconsistently by the SQL formatter. This closes #83092.

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jul 12, 2025

Workflow [PR], commit [d710efb]

Summary:

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Jul 12, 2025
Copy link
Copy Markdown
Member

@pamarcos pamarcos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems something's wonky/out of sync in private cause the flaky check complained there regarding 02230_create_table_as_ignore_ttl, and the test itself hasn't changed in 3 years. The reference file was changed recently, though:

025-07-15 10:02:54 Reason: result differs with reference:  
2025-07-15 10:02:54 --- /home/ubuntu/actions-runner/_work/clickhouse-private/clickhouse-private/tests/queries/0_stateless/02230_create_table_as_ignore_ttl.reference	2025-07-15 09:53:59.396624216 -0400
2025-07-15 10:02:54 +++ /home/ubuntu/actions-runner/_work/clickhouse-private/clickhouse-private/tests/queries/0_stateless/02230_create_table_as_ignore_ttl.3782.stdout	2025-07-15 10:02:52.701189952 -0400
2025-07-15 10:02:54 @@ -1,32 +1,4 @@
2025-07-15 10:02:54 -CREATE TABLE default.data_02230_ttl
2025-07-15 10:02:54 -(
2025-07-15 10:02:54 -    `date` Date,
2025-07-15 10:02:54 -    `key` Int32
2025-07-15 10:02:54 -)
2025-07-15 10:02:54 -ENGINE = MergeTree
2025-07-15 10:02:54 -ORDER BY key
2025-07-15 10:02:54 -TTL date + 14
2025-07-15 10:02:54 -SETTINGS index_granularity = 8192
2025-07-15 10:02:54 -CREATE TABLE default.null_02230_ttl
2025-07-15 10:02:54 -(
2025-07-15 10:02:54 -    `date` Date,
2025-07-15 10:02:54 -    `key` Int32
2025-07-15 10:02:54 -)
2025-07-15 10:02:54 -ENGINE = `Null`
2025-07-15 10:02:54 -CREATE TABLE default.data_02230_column_ttl
2025-07-15 10:02:54 -(
2025-07-15 10:02:54 -    `date` Date,
2025-07-15 10:02:54 -    `value` Int32 TTL date + 7,
2025-07-15 10:02:54 -    `key` Int32
2025-07-15 10:02:54 -)
2025-07-15 10:02:54 -ENGINE = MergeTree
2025-07-15 10:02:54 -ORDER BY key
2025-07-15 10:02:54 -TTL date + 14
2025-07-15 10:02:54 -SETTINGS index_granularity = 8192
2025-07-15 10:02:54 -CREATE TABLE default.null_02230_column_ttl
2025-07-15 10:02:54 -(
2025-07-15 10:02:54 -    `date` Date,
2025-07-15 10:02:54 -    `value` Int32,
2025-07-15 10:02:54 -    `key` Int32
2025-07-15 10:02:54 -)
2025-07-15 10:02:54 -ENGINE = `Null`
2025-07-15 10:02:54 +CREATE TABLE default.data_02230_ttl\n(\n    `date` Date,\n    `key` Int32\n)\nENGINE = MergeTree\nORDER BY key\nTTL date + 14\nSETTINGS index_granularity = 8192
2025-07-15 10:02:54 +CREATE TABLE default.null_02230_ttl\n(\n    `date` Date,\n    `key` Int32\n)\nENGINE = `Null`
2025-07-15 10:02:54 +CREATE TABLE default.data_02230_column_ttl\n(\n    `date` Date,\n    `value` Int32 TTL date + 7,\n    `key` Int32\n)\nENGINE = MergeTree\nORDER BY key\nTTL date + 14\nSETTINGS index_granularity = 8192
2025-07-15 10:02:54 +CREATE TABLE default.null_02230_column_ttl\n(\n    `date` Date,\n    `value` Int32,\n    `key` Int32\n)\nENGINE = `Null`
2025-07-15 10:02:54 
2025-07-15 10:02:54 
2025-07-15 10:02:54 Settings used in the test: --max_insert_threads 3 --group_by_two_level_threshold 1 --group_by_two_level_threshold_bytes 1 --distributed_aggregation_memory_efficient 1 --fsync_metadata 1 --output_format_parallel_formatting 0 --input_format_parallel_parsing 1 --min_chunk_bytes_for_parallel_parsing 2438772 --max_read_buffer_size 515450 --prefer_localhost_replica 1 --max_block_size 38426 --max_joined_block_size_rows 13207 --max_threads 1 --optimize_append_index 0 --use_hedged_requests 0 --optimize_if_chain_to_multiif 0 --optimize_if_transform_strings_to_enum 1 --optimize_read_in_order 1 --optimize_or_like_chain 0 --optimize_substitute_columns 0 --enable_multiple_prewhere_read_steps 0 --read_in_order_two_level_merge_threshold 40 --optimize_aggregation_in_order 0 --aggregation_in_order_max_block_bytes 26329069 --use_uncompressed_cache 0 --min_bytes_to_use_direct_io 2960721046 --min_bytes_to_use_mmap_io 9198476538 --local_filesystem_read_method pread --local_filesystem_read_prefetch 1 --filesystem_cache_segments_batch_size 5 --read_from_filesystem_cache_if_exists_otherwise_bypass_cache 1 --throw_on_error_from_cache_on_write_operations 1 --remote_filesystem_read_prefetch 1 --distributed_cache_discard_connection_if_unread_data 0 --allow_prefetched_read_pool_for_remote_filesystem 1 --filesystem_prefetch_max_memory_usage 32Mi --filesystem_prefetches_limit 10 --filesystem_prefetch_min_bytes_for_single_read_task 8Mi --filesystem_prefetch_step_marks 0 --filesystem_prefetch_step_bytes 0 --compile_expressions 0 --compile_aggregate_expressions 1 --compile_sort_description 0 --merge_tree_coarse_index_granularity 26 --optimize_distinct_in_order 0 --max_bytes_before_remerge_sort 2286677828 --min_compress_block_size 1078303 --max_compress_block_size 553043 --merge_tree_compact_parts_min_granules_to_multibuffer_read 70 --optimize_sorting_by_input_stream_properties 0 --http_response_buffer_size 7007827 --http_wait_end_of_query False --enable_memory_bound_merging_of_aggregation_results 1 --min_count_to_compile_expression 3 --min_count_to_compile_aggregate_expression 3 --min_count_to_compile_sort_description 3 --session_timezone America/Hermosillo --use_page_cache_for_disks_without_file_cache True --page_cache_inject_eviction True --merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability 0.93 --prefer_external_sort_block_bytes 100000000 --cross_join_min_rows_to_compress 0 --cross_join_min_bytes_to_compress 100000000 --min_external_table_block_size_bytes 100000000 --max_parsing_threads 0 --optimize_functions_to_subcolumns 1 --parallel_replicas_local_plan 1 --query_plan_join_swap_table auto --enable_vertical_final 0 --optimize_extract_common_expressions 1 --use_query_condition_cache 1 --secondary_indices_enable_bulk_filtering 0 --use_skip_indexes_if_final 0 --max_bytes_before_external_sort 0 --max_bytes_before_external_group_by 0 --max_bytes_ratio_before_external_sort 0.16 --max_bytes_ratio_before_external_group_by 0.01 --use_skip_indexes_if_final_exact_mode 0
2025-07-15 10:02:54 
2025-07-15 10:02:54 Database: test_hyorhhvq

SELECT f(`@`); -- { serverError UNKNOWN_IDENTIFIER }
SELECT `@`(1); -- { serverError UNKNOWN_FUNCTION }
SELECT ` `(1); -- { serverError UNKNOWN_FUNCTION }
SELECT `упячка`(1); -- { serverError UNKNOWN_FUNCTION }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You made me search what упячка means 😅

@pamarcos pamarcos self-assigned this Jul 15, 2025
@alexey-milovidov
Copy link
Copy Markdown
Member Author

@pamarcos that's very strange. I even checked the test locally with the private build, and it passes.

@alexey-milovidov
Copy link
Copy Markdown
Member Author

For some reason, this test was modified in the private repository. I will bring it back to normal.

@alexey-milovidov alexey-milovidov merged commit ec338cd into master Jul 17, 2025
120 of 121 checks passed
@alexey-milovidov alexey-milovidov deleted the fix-formatting-functions-codecs branch July 17, 2025 16:01
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LOGICAL_ERROR] Inconsistent AST formatting with ALTER CODEC

3 participants