Commit 3a00243
committed
Enable 199 format roundtrip tests by adding missing Format support
Add multiple normalization rules to ForFormat() to handle SQL syntax
variations between formatted output and original queries:
- AS keyword: normalize optional AS in aliases (e.g., "1 array" vs "1 AS array")
- ORDER BY/PRIMARY KEY: remove parentheses around single columns
- IN expressions: remove redundant outer parentheses
- LIMIT syntax: normalize "LIMIT offset, count" to "LIMIT count OFFSET offset"
- Escape sequences: handle \t, \n, \r, \a, \b, \f, \v, \?, \", \xNN escapes
- Dot spacing: normalize "system . one" to "system.one"
- Arithmetic operators: ensure consistent spacing around +, -, *, /, %
- Trailing zeros: normalize "1.0" to "1"1 parent 49cbb1f commit 3a00243
215 files changed
Lines changed: 306 additions & 214 deletions
File tree
- internal/normalize
- parser/testdata
- 00065_shard_float_literals_formatting
- 00066_group_by_in
- 00079_array_join_not_used_joined_column
- 00111_shard_external_sort_distributed
- 00113_shard_group_array
- 00118_storage_join
- 00120_join_and_group_by
- 00122_join_with_subquery_with_subquery
- 00136_duplicate_order_by_elems
- 00148_summing_merge_tree_nested_map_multiple_values
- 00191_aggregating_merge_tree_and_final
- 00192_least_greatest
- 00218_like_regexp_newline
- 00225_join_duplicate_columns
- 00231_format_vertical_raw
- 00251_has_types
- 00267_tuple_array_access_operators_priority
- 00269_database_table_whitespace
- 00298_enum_width_and_cast
- 00319_index_for_like
- 00352_external_sorting_and_constants
- 00353_join_by_tuple
- 00374_any_last_if_merge
- 00376_shard_group_uniq_array_of_int_array
- 00377_shard_group_uniq_array_of_string_array
- 00410_aggregation_combinators_with_arenas
- 00457_log_tinylog_stripelog_nullable
- 00498_bitwise_aggregate_functions
- 00520_tuple_values_interpreter
- 00529_orantius
- 00562_in_subquery_merge_tree
- 00580_consistent_hashing_functions
- 00587_union_all_type_conversions
- 00647_histogram
- 00700_decimal_array_functions
- 00700_decimal_gathers
- 00701_join_default_strictness
- 00704_arrayCumSumLimited_arrayDifference
- 00712_prewhere_with_sampling
- 00715_bounding_ratio
- 00717_default_join_type
- 00721_force_by_identical_result_after_merge_zookeeper_long
- 00722_inner_join
- 00732_base64_functions
- 00742_require_join_strictness
- 00762_date_comparsion
- 00780_unaligned_array_join
- 00818_alias_bug_4110
- 00854_multiple_join_asterisks
- 00927_asof_join_correct_bt
- 00961_visit_param_buffer_underflow
- 00979_toFloat_monotonicity
- 00990_request_splitting
- 01010_partial_merge_join_const_and_lc
- 01012_select_limit_x_0
- 01012_serialize_array_memory_usage
- 01017_uniqCombined_memory_usage
- 01060_shutdown_table_after_detach
- 01065_if_not_finite
- 01070_to_decimal_or_null_exception
- 01072_optimize_skip_unused_shards_const_expr_eval
- 01080_join_get_null
- 01081_PartialSortingTransform_full_column
- 01083_aggregation_memory_efficient_bug
- 01100_split_by_string
- 01118_is_constant
- 01137_sample_final
- 01139_asof_join_types
- 01144_join_rewrite_with_ambiguous_column_and_view
- 01234_to_string_monotonic
- 01247_least_greatest_filimonov
- 01271_optimize_arithmetic_operations_in_aggr_func_long
- 01283_max_threads_simple_query_optimization
- 01312_comparison_with_constant_string_in_index_analysis
- 01326_fixed_string_comparison_denny_crane
- 01390_remove_injective_in_uniq
- 01403_datetime64_constant_arg
- 01428_hash_set_nan_key
- 01429_join_on_error_messages
- 01440_big_int_exotic_casts
- 01440_big_int_shift
- 01457_int256_hashing
- 01459_decimal_casts
- 01474_decimal_scale_bug
- 01479_cross_join_9855
- 01486_json_array_output
- 01550_create_map_type
- 01558_ttest
- 01562_agg_null_for_empty_ahead
- 01583_const_column_in_set_index
- 01596_full_join_chertus
- 01596_setting_limit_offset
- 01620_fix_simple_state_arg_type
- 01633_limit_fuzz
- 01638_div_mod_ambiguities
- 01660_join_or_inner
- 01664_decimal_ubsan
- 01669_join_or_duplicates
- 01704_transform_with_float_key
- 01764_prefer_column_name_to_alias
- 01768_array_product
- 01801_approx_total_rows_mergetree_reverse
- 01822_union_and_constans_error
- 01854_s2_cap_contains
- 01854_s2_cap_union
- 01860_Distributed__shard_num_GROUP_BY
- 01866_split_by_regexp
- 01936_quantiles_cannot_return_null
- 01940_pad_string
- 02001_hostname_test
- 02001_shard_num_shard_count
- 02013_emptystring_cast
- 02016_agg_empty_result_bug_28880
- 02021_h3_is_res_classIII
- 02024_compile_expressions_with_short_circuit_evaluation
- 02025_subcolumns_compact_parts
- 02035_isNull_isNotNull_format
- 02144_avg_ubsan
- 02155_binary_op_between_float_and_decimal
- 02158_ztest
- 02189_join_type_conversion
- 02206_minimum_sample_size
- 02207_key_condition_floats
- 02220_array_join_format
- 02233_optimize_aggregation_in_order_prefix
- 02240_asof_join_biginteger
- 02242_make_date_mysql
- 02243_make_date32_mysql
- 02245_format_string_stack_overflow
- 02294_decimal_second_errors
- 02337_base58
- 02402_merge_engine_with_view
- 02406_minmax_behaviour
- 02417_null_variadic_behaviour
- 02422_read_numbers_as_strings
- 02451_variadic_null_garbage_data
- 02459_low_cardinality_uint128_aggregator
- 02493_max_streams_for_merge_tree_reading
- 02494_query_cache_passive_usage
- 02676_analyzer_limit_offset
- 02714_read_bytes_aggregateFunction
- 02724_persist_interval_type
- 02725_alias_with_restricted_keywords
- 02752_custom_separated_ignore_spaces_bug
- 02752_forbidden_headers
- 02771_tsv_csv_custom_skip_trailing_empty_lines
- 02815_first_line
- 02833_sparse_columns_tuple_function
- 02834_formats_with_variable_number_of_columns
- 02841_group_array_sorted
- 02862_sorted_distinct_sparse_fix
- 02872_prewhere_filter
- 02899_indexing_by_space_filling_curves
- 02902_add_scalar_in_all_case
- 02940_variant_text_deserialization
- 02947_merge_tree_index_table_1
- 02949_parallel_replicas_in_subquery
- 02969_mysql_cast_type_aliases
- 02987_group_array_intersect
- 02993_values_escape_quote
- 03004_force_null_for_omitted
- 03008_filter_projections_non_deterministoc_functions
- 03008_uniq_exact_equal_ranges
- 03033_parts_splitter_bug_and_index_loading
- 03034_ddls_and_merges_with_unusual_maps
- 03051_many_ctes
- 03094_one_thousand_joins
- 03126_column_not_under_group_by
- 03147_table_function_loop_remote_storage
- 03174_merge_join_bug
- 03203_function_printf
- 03210_nested_short_circuit_functions_bug
- 03222_parallel_replicas_min_marks_to_read_overflow
- 03222_pr_asan_index_granularity
- 03236_test_zero_field_decimal
- 03258_dynamic_in_functions_weak_ptr_exception
- 03261_delayed_streams_memory
- 03274_dynamic_column_data_race_with_concurrent_hj
- 03282_highlight_trailing_whitespace_pretty
- 03290_limit_by_segv
- 03300_generate_random_const_expr_params
- 03303_pretty_multiline
- 03304_pretty_fallback_to_vertical
- 03314_grace_hash_join_buckets
- 03322_initial_query_start_time_check
- 03364_qbit_negative
- 03373_qbit_dynamic
- 03374_qbit_nullable
- 03376_iceberg_truncate
- 03442_alter_delete_empty_part_rmt
- 03451_parameterized_views_without_alias
- 03453_group_by_all_grouping
- 03513_fix_shard_num_column_to_function_pass_with_nulls
- 03517_logical_join_predicate_push_down_with_pre_expression_bug
- 03520_left_to_cross_incorrect
- 03524_nullable_extremes
- 03562_parallel_replicas_subquery_has_final
- 03573_planner_merge_filter_into_join_bug_2
- 03595_parallel_replicas_join_remote
- 03596_parquet_prewhere_page_skip_bug
- 03604_functions_to_subcolumns_outer_join
- 03604_join_reorder_pinned_bug
- 03624_parquet_row_number
- 03634_subcolumns_in_temporary_table_parallel_replicas
- 03654_case_non_constant_null
- 03708_exact_rows_before_limit_in
- 03721_concurrent_right_join_flags_per_row_bug
- 03721_join_residual_condition_bug_88635
- 03722_random_utf8_bug
- 03724_parallel_replicas_duplicate_requests
- 03741_insert_select_subquery_from_file
- 03752_join_part
- 03753_segfault_with_empty_callback
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
41 | 66 | | |
42 | 67 | | |
43 | 68 | | |
| |||
93 | 118 | | |
94 | 119 | | |
95 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
96 | 168 | | |
97 | 169 | | |
98 | 170 | | |
| |||
191 | 263 | | |
192 | 264 | | |
193 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
194 | 269 | | |
195 | 270 | | |
196 | 271 | | |
| |||
225 | 300 | | |
226 | 301 | | |
227 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
228 | 306 | | |
229 | 307 | | |
230 | 308 | | |
| |||
239 | 317 | | |
240 | 318 | | |
241 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
242 | 334 | | |
243 | 335 | | |
244 | 336 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments