Skip to content

New JSON-type fuzzing proposal #68676

@nikitamikhaylov

Description

@nikitamikhaylov

Company or project name

ClickHouse inc.

Use case

Since the new type has been merged #66444 we need to test it continuously.

Describe the solution you'd like

The proposal is relatively simple:

  • CREATE TABLE (j JSON) ENGINE = X, X can be Memory, ReplacingMergeTree, SummingMergeTree, etc.
  • Generate random JSON objects and generate INSERT statements based on them. We can try to use libprotobuf-mutator from LLVM and convert Protobuf to JSON or do something even smarter. fuzzJSON table function can also help here.

As a result we will have a bunch of JSON objects like {"a": 1, "b": 2} or {"c" : {"d": 3}} . Additionally we will track all the keys and how they nest to each other (in a form of a tree).

graph TD;
    j;
    j;
    j-->a;
    j-->b;
    j-->c;
    c-->d;
Loading

This diagram means in table j we have the following columns and subcolumns: j.a, j.b, j.c.d. We then can write down all possible paths and use them as identifiers for other queries like SELECTs, UPDATEs or DELETEs. They can be generated special mode of AST Fuzzer embedded into clickhouse-client.

We will pack everything together and then run in the CI.

@Avogar thoughts?

Metadata

Metadata

Assignees

Labels

enhancementjsonIssues and pull-requests related to the new JSON data type

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions