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

feat(sqlsmith): fuzz test support read Sqlite and Duckdb test #17301

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Jan 16, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Fuzz test support read Sqlite and Duckdb test, we can use test SQLs in Sqlite and Duckdb to generate fuzz SQLs.
for example:

➜  databend git:(feat-sqlsmith-log) ✗ ./target/debug/databend-sqlsmith --port 48000 --fuzz-path ../sqlite/test
2025-01-16T04:06:51.884668Z  INFO databend_sqlsmith::runner: orig sql:  DROP TABLE IF EXISTS t2;
2025-01-16T04:06:51.885408Z  INFO databend_sqlsmith::runner: fuzz sql: DROP TABLE IF EXISTS t2
2025-01-16T04:06:51.907046Z  INFO databend_sqlsmith::runner: orig sql:  CREATE TABLE t2(a INTEGER , b INTEGER);
2025-01-16T04:06:51.907878Z  INFO databend_sqlsmith::runner: fuzz sql: CREATE TABLE t2 (a Int32, b Int32)
➜  databend git:(feat-sqlsmith-log) ✗ ./target/debug/databend-sqlsmith --port 48000 --fuzz-path ../duckdb/test/sql/window
2025-01-16T04:07:26.590939Z  INFO databend_sqlsmith::runner: orig sql: PRAGMA enable_verification
2025-01-16T04:07:26.592078Z  INFO databend_sqlsmith::runner: orig sql: CREATE TABLE empsalary (depname varchar, empno bigint, salary int, enroll_date date)
2025-01-16T04:07:26.592968Z  INFO databend_sqlsmith::runner: fuzz sql: CREATE TABLE empsalary (depname STRING, empno Int64, salary Int32, enroll_date DATE)
2025-01-16T04:07:26.617183Z  INFO databend_sqlsmith::runner: orig sql: INSERT INTO empsalary VALUES ('develop', 10, 5200, '2007-08-01'), ('sales', 1, 5000, '2006-10-01'), ('personnel', 5, 3500, '2007-12-10'), ('sales', 4, 4800, '2007-08-08'), ('personnel', 2, 3900, '2006-12-23'), ('develop', 7, 4200, '2008-01-01'), ('develop', 9, 4500, '2008-01-01'), ('sales', 3, 4800, '2007-08-01'), ('develop', 8, 6000, '2006-10-01'), ('develop', 11, 5200, '2007-08-15')

other changes:

  1. Simplify the window function parser
  2. Sqlsmith save SQLs to file, used for replay
  3. Add generate some new functions

part of : #17130

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@b41sh b41sh requested a review from sundy-li January 16, 2025 04:12
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Jan 16, 2025
@BohuTANG BohuTANG merged commit 3a32c18 into databendlabs:main Jan 18, 2025
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants