Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed testAggregateExpr test #2940

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

yesh385
Copy link

@yesh385 yesh385 commented Oct 18, 2023

This PR fixes a test called DruidMysqlRouteStrategyTest.testAggregateExpr which can be found here.

  1. What does this test do?

This test is responsible for testing the behavior of the route strategy when processing SQL queries with aggregate functions and different aliasing scenarios. It checks if the result set correctly identifies and names the aggregated columns.

  1. Why does this test fail?

This test fails because we are checking if the HashMap returned by getMergeCols() method contains the column name as a key while not checking for case sensitivity.

  1. How I fixed?

This PR fixes this issue by updating the key name into uppercase.

The assertion happens here:

Assert.assertTrue(rrs.getMergeCols().containsKey("count2"));

You can run the following command to run the test:

mvn test -Dtest=io.mycat.route.DruidMysqlRouteStrategyTest#testAggregateExpr

Test Environment:

java version "1.8.0_202"
Apache Maven 3.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant