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

Improved/fixed aggregate function error messages. #8977

Merged
merged 1 commit into from
Apr 8, 2022
Merged

Conversation

krisajenkins
Copy link
Contributor

Description

If you call the sum function with an unsupported argument type, it
throws an error complaining about the max function. This is clearly a
copy & paste error. I've fixed it, and amended the code to make future
copy & paste errors less likely.

Fixes #8976.

Testing done

This is just an error message improvement, so there are no additional tests.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@krisajenkins krisajenkins requested a review from a team as a code owner April 5, 2022 12:44
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Kris Jenkins seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@Gerrrr Gerrrr left a comment

Choose a reason for hiding this comment

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

Thank you for opening the PR! The change looks good.

Can you please prefix the commit message with fix: and force-push? We generate release changelogs from commit messages, so all non-merge commits should be prefixed with the change category, such as feat:, fix:, chore:, etc.

@krisajenkins
Copy link
Contributor Author

Ah, sure thing @Gerrrr. Done! 👍

@Gerrrr
Copy link
Contributor

Gerrrr commented Apr 5, 2022

Let's wait for the CI results and then merge. I am posting the link to the CI job here as the GH checks seem to be borked - https://jenkins.confluent.io/job/Confluent%20Public%20Repo%20PR%20builder/job/ksql/job/PR-8977/.

@krisajenkins
Copy link
Contributor Author

Perfect. Thank you!

@jnh5y
Copy link
Member

jnh5y commented Apr 5, 2022

CI failed with

[2022-04-05T13:45:06.913Z] [ERROR] /home/jenkins/workspace/lic_Repo_PR_builder_ksql_PR-8977/ksqldb-engine/src/main/java/io/confluent/ksql/function/udaf/topkdistinct/TopkDistinctAggFunctionFactory.java:72: Line is longer than 100 characters (found 110). [LineLength]
[2022-04-05T13:45:06.913Z] [ERROR] /home/jenkins/workspace/lic_Repo_PR_builder_ksql_PR-8977/ksqldb-engine/src/main/java/io/confluent/ksql/function/udaf/min/MinAggFunctionFactory.java:56: Line is longer than 100 characters (found 110). [LineLength]
[2022-04-05T13:45:06.914Z] [ERROR] /home/jenkins/workspace/lic_Repo_PR_builder_ksql_PR-8977/ksqldb-engine/src/main/java/io/confluent/ksql/function/udaf/sum/SumAggFunctionFactory.java:58: Line is longer than 100 characters (found 110). [LineLength]
[2022-04-05T13:45:06.914Z] [ERROR] /home/jenkins/workspace/lic_Repo_PR_builder_ksql_PR-8977/ksqldb-engine/src/main/java/io/confluent/ksql/function/udaf/topk/TopKAggregateFunctionFactory.java:95: Line is longer than 100 characters (found 111). [LineLength]

building locally with ./mvnw clean install -DskipTests -T4 -Dassembly.skipAssembly -Dmaven.gitcommitid.skip will check for annoying errors like that.

Shout if you want a hand, etc.

@krisajenkins
Copy link
Contributor Author

Thanks for the tip @jnh5y!

@Gerrrr, I've pushed a fix, refined the code a little along the way, and added a test case for SUM. Let me know if you'd like test cases for the other aggregates. They'd be a bit boilerplate but I'm happy to add them if you want.

@Gerrrr
Copy link
Contributor

Gerrrr commented Apr 7, 2022

PR looks good to me and the CI is green. Please prefix the commit message with fix: and it is ready to merge.

If you call the `sum` function with an unsupported argument type, it
throws an error complaining about the `max` function. This is clearly a
copy & paste error. I've fixed it and amended the code to make future
copy & paste errors less likely. There's also some testing around this message.

Fixes #8976.
@krisajenkins
Copy link
Contributor Author

Oops - I should have remembered that! Done. :-)

@Gerrrr
Copy link
Contributor

Gerrrr commented Apr 7, 2022

Awesome! I'll merge the PR tomorrow in the morning.

@Gerrrr Gerrrr merged commit 57f3596 into master Apr 8, 2022
@Gerrrr Gerrrr deleted the fix-8976 branch April 8, 2022 09:02
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.

Bad error message if you use the SUM function with an unrecognised argument type.
4 participants