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

Fix error in benchmark queries #1560

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Fix error in benchmark queries #1560

merged 1 commit into from
Nov 27, 2024

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 26, 2024

Right now the benchmarks are measuring how fast we can generate error messages

@@ -23,24 +23,24 @@ fn basic_queries(c: &mut Criterion) {
let mut group = c.benchmark_group("sqlparser-rs parsing benchmark");
let dialect = GenericDialect {};

let string = "SELECT * FROM table WHERE 1 = 1";
let string = "SELECT * FROM my_table WHERE 1 = 1";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

"table" is a keyword so you can't use it as a table name without putting it in quotes

group.bench_function("sqlparser::select", |b| {
b.iter(|| Parser::parse_sql(&dialect, string));
b.iter(|| Parser::parse_sql(&dialect, string).unwrap());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The unwrap now actually checks the error

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM!

@alamb
Copy link
Contributor Author

alamb commented Nov 27, 2024

Thank you for the review @iffyio

@alamb alamb merged commit 5a510ac into apache:main Nov 27, 2024
8 checks passed
@alamb alamb deleted the alamb/fix_bench branch November 27, 2024 16:33
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.

Sqlparser Benchmarks are erroring
2 participants