When sort_by_metric is true, buildQuery unconditionally appended a
secondary ORDER BY series ASC alongside the metric sort. On Druid, any
multi-column ORDER BY prevents the native TopN query optimization,
forcing a full GroupBy scan that can cause dramatic slowdowns and
timeouts on high-cardinality dimensions.
Make the series sort mutually exclusive with sort_by_metric, and add
test coverage for both sort behaviors.
Fixes#39072