Skip to content

Commit e3a48c0

Browse files
committed
Fix more tests
1 parent 3c8e180 commit e3a48c0

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

src/Analyzer/Passes/CountDistinctPass.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <Analyzer/Utils.h>
1313

1414
#include <Core/Settings.h>
15+
#include <Storages/IStorage.h>
1516

1617
namespace DB
1718
{
@@ -35,10 +36,6 @@ class CountDistinctVisitor : public InDepthQueryTreeVisitorWithContext<CountDist
3536
if (!getSettings()[Setting::count_distinct_optimization])
3637
return;
3738

38-
/// TODO(amos): find a better way to resolve this setting confliction
39-
// if (getSettings()[Setting::optimize_distributed_group_by_sharding_key])
40-
// return;
41-
4239
auto * query_node = node->as<QueryNode>();
4340

4441
/// Check that query has only SELECT clause
@@ -52,6 +49,13 @@ class CountDistinctVisitor : public InDepthQueryTreeVisitorWithContext<CountDist
5249
if (join_tree_node_type == QueryTreeNodeType::JOIN || join_tree_node_type == QueryTreeNodeType::CROSS_JOIN || join_tree_node_type == QueryTreeNodeType::ARRAY_JOIN)
5350
return;
5451

52+
/// Check only local table
53+
if (auto * table_node = query_node->getJoinTree()->as<TableNode>())
54+
{
55+
if (table_node->getStorage()->isRemote())
56+
return;
57+
}
58+
5559
/// Check that query has only single node in projection
5660
auto & projection_nodes = query_node->getProjection().getNodes();
5761
if (projection_nodes.size() != 1)

src/Processors/QueryPlan/Optimizations/optimizeOrderByLimit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ size_t tryPushDownOrderByLimit(QueryPlan::Node * parent_node, QueryPlan::Nodes &
5959
return 0;
6060

6161
const auto & sort_column = sorting_step->getInputHeaders().front()->getByName(sort_description.front().column_name);
62-
if (!sort_column.type->isValueRepresentedByNumber() && read_from_mergetree_step->getPrewhereInfo())
62+
if (!sort_column.type->isValueRepresentedByNumber() || read_from_mergetree_step->getPrewhereInfo())
6363
return 0;
6464

6565
const auto * sort_column_from_read

tests/queries/0_stateless/00944_minmax_nan.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SET parallel_replicas_local_plan = 1;
22

33
-- Force using skip indexes in planning to proper test `force_data_skipping_indices` setting.
44
SET use_skip_indexes_on_data_read = 0;
5+
SET use_query_condition_cache = 0;
56

67
-- Test for issue #75523
78

tests/queries/0_stateless/03100_lwu_36_json_skip_indexes.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
-- Force using skip indexes in planning to proper test `force_data_skipping_indices` setting.
55
SET use_skip_indexes_on_data_read = 0;
6+
SET use_query_condition_cache = 0;
67

78
DROP TABLE IF EXISTS test;
89

tests/queries/0_stateless/03443_index_match_alternatives.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- Force using skip indexes in planning to proper test with EXPLAIN indexes = 1.
22
SET use_skip_indexes_on_data_read = 0;
3+
SET use_query_condition_cache = 0;
34

45
DROP TABLE IF EXISTS 03443_data;
56

0 commit comments

Comments
 (0)