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

[SPARK-44268][CORE][TEST][FOLLOWUP] Add test to generate sql-error-conditions doc automatic #41865

Closed

Conversation

Hisoka-X
Copy link
Member

@Hisoka-X Hisoka-X commented Jul 5, 2023

What changes were proposed in this pull request?

This is a follow up PR for #41813, change test to automatic generate sql-error-conditions doc. Like other GOLDEN_FILES test, if the doc not match will report a error during test.

Why are the changes needed?

  1. make sure the error-classes.json sync with doc
  2. and developer sync doc easier.

Does this PR introduce any user-facing change?

No

How was this patch tested?

add new test.

@Hisoka-X
Copy link
Member Author

Hisoka-X commented Jul 5, 2023

cc @MaxGekk @beliefer

s"Error class: $errorClass does not contain sub class: $s in error-classes.json")
s
def quoteParameter(content: String): String = {
"(?<!MAP|STRUCT|ARRAY)<(.*?)>".r.replaceAllIn(content, (m: Regex.Match) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

@MaxGekk I updated the rule, fix all problems you metioned. Please check the rule is ok or not. Thanks.

@@ -55,7 +55,7 @@ Thousands separators (, or G) may not appear after the decimal point in the numb

## UNEXPECTED_TOKEN

Found the unexpected `<token>` in the format string; the structure of the format string must match: `[MI|S]` `[$]` `[0|9|G|,]*` `[.|D]` `[0|9]*` `[$]` `[PR|MI|S]`.
Found the unexpected `<token>` in the format string; the structure of the format string must match: [MI|S] [$] [0|9|G|,]* [.|D] [0|9]* [$] [PR|MI|S].
Copy link
Member Author

@Hisoka-X Hisoka-X Jul 6, 2023

Choose a reason for hiding this comment

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

This one a little special, can I add "`" quote in error-classes.json to make sure [MI|S] has `[MI|S]`?

Copy link
Member

Choose a reason for hiding this comment

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

Yep

@Hisoka-X Hisoka-X force-pushed the SPARK-44268_error_json_follow_up branch from 4568225 to f1b13d4 Compare July 6, 2023 05:31
Copy link
Contributor

@beliefer beliefer left a comment

Choose a reason for hiding this comment

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

LGTM.

@HyukjinKwon
Copy link
Member

Merged to master.

@Hisoka-X
Copy link
Member Author

Hisoka-X commented Jul 7, 2023

Thanks @HyukjinKwon @MaxGekk @beliefer

@Hisoka-X Hisoka-X deleted the SPARK-44268_error_json_follow_up branch July 7, 2023 23:59
ragnarok56 pushed a commit to ragnarok56/spark that referenced this pull request Mar 2, 2024
…onditions` doc automatic

### What changes were proposed in this pull request?
This is a follow up PR for apache#41813, change test to automatic generate `sql-error-conditions` doc. Like other GOLDEN_FILES test, if the doc not match will report a error during test.

### Why are the changes needed?
1. make sure the `error-classes.json` sync with doc
2. and developer sync doc easier.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
add new test.

Closes apache#41865 from Hisoka-X/SPARK-44268_error_json_follow_up.

Authored-by: Jia Fan <fanjiaeminem@qq.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants