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

Better error msg for validity check of geography #4601

Merged
merged 6 commits into from
Sep 7, 2022

Conversation

jievince
Copy link
Contributor

@jievince jievince commented Aug 31, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Description:

When geography dataum is found to be illegal, print the specific cause of the error to facilitate troubleshooting.
eg.

E20220902 03:24:24.550307 350836 FunctionManager.cpp:2440] ST_GeogFromText error: The geography LINESTRING(0 1, 2 3) built from wkt LINESTRING(0 1, 2 3) is invalid, error: FindValidationError, S2 Errorcode: 1, message: Vertex 0 is not unit length

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@jievince jievince force-pushed the better-err-msg-for-geo branch from d505057 to 97fbc07 Compare August 31, 2022 09:40
@jievince jievince added the ready-for-testing PR: ready for the CI test label Aug 31, 2022
@jievince jievince force-pushed the better-err-msg-for-geo branch from 0328443 to 4e0490c Compare August 31, 2022 11:06
@jievince jievince force-pushed the better-err-msg-for-geo branch 3 times, most recently from ae4fc8c to e21f053 Compare September 2, 2022 12:15
Aiee
Aiee previously approved these changes Sep 5, 2022
@jievince jievince changed the title better error msg for isValid of geography better error msg for validity check of geography Sep 5, 2022
@jievince jievince changed the title better error msg for validity check of geography Better error msg for validity check of geography Sep 5, 2022
@@ -2511,7 +2511,8 @@ FunctionManager::FunctionManager() {
if (!args[0].get().isGeography()) {
return Value::kNullBadType;
}
return args[0].get().getGeography().isValid();
auto status = args[0].get().getGeography().isValid();
return status.ok() ? true : false;
Copy link
Contributor

@Shylock-Hg Shylock-Hg Sep 5, 2022

Choose a reason for hiding this comment

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

It seems doesn't affect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed it here, thanks

czpmango
czpmango previously approved these changes Sep 6, 2022
Copy link
Contributor

@czpmango czpmango left a comment

Choose a reason for hiding this comment

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

LGTM

@jievince jievince dismissed stale reviews from czpmango and Aiee via 4a07114 September 6, 2022 02:47
@jievince jievince force-pushed the better-err-msg-for-geo branch from d394c6e to 4a07114 Compare September 6, 2022 02:47
@jievince jievince requested a review from dutor September 7, 2022 06:38
@codesigner codesigner merged commit 6898ebb into vesoft-inc:master Sep 7, 2022
@jievince jievince deleted the better-err-msg-for-geo branch September 7, 2022 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants