Git Product home page Git Product logo

sqlfuzz's Introduction

SQL Fuzz Testing Utilities

sqlfuzz is a command-line tool and library for generating random data files and SQL queries.

For background information on SQL fuzzing, I recommend reading the paper SparkFuzz: Searching Correctness Regressions in Modern Query Engines.

Status

  • Generate random SQL queries against any provided input files
  • Generate randomized data files
  • Provide tooling to execute queries and capture results
    • DataFusion
    • Apache Spark
    • PostgreSQL
  • Provide tooling to compare two sets of results and report differences

Installation

cargo install sqlfuzz

SQL Query Fuzzing

Use the following syntax to generate randomized SQL queries against the example data files in this repository.

sqlfuzz query \
  --table ./testdata/test0.parquet ./testdata/test1.parquet \
  --join-type inner left right full semi anti \
  --count 5 \
  --max-depth 5

Example Generated Query

SELECT __c320, __c321, __c322, __c323
FROM (
    (SELECT test1.c0 AS __c320, test1.c1 AS __c321, test1.c2 AS __c322, test1.c3 AS __c323
    FROM (test1))
    INNER JOIN
    (SELECT test1.c0 AS __c324, test1.c1 AS __c325, test1.c2 AS __c326, test1.c3 AS __c327
    FROM (test1))
    ON __c320 = __c327)
WHERE __c323 > __c320;

Data Generator

sqlfuzz can generate random data files to run the query fuzzer against. The files are generated in Parquet format.

sqlfuzz data --path ./testdata --num-files 4 --row-count 20

sqlfuzz's People

Contributors

andygrove avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.