Skip to content

Conversation

Mytherin
Copy link
Collaborator

This PR adds a new fuzzer function fuzz_all_functions that generates queries to fuzz all scalar and aggregate functions using test_all_types and test_vector_types.

CALL fuzz_all_functions(verbose_output=true, log='queries.out', complete_log='queries.complete.out');

This fuzzes all functions by generating queries like this:

SELECT bit_or(ubigint) FROM test_all_types;
SELECT floor(c1) FROM test_vector_types(CAST(NULL AS DOUBLE)) AS test_vector_types(c1);
test_vector_types

In addition, we rework test_vector_types so that the all_flat parameter is now a named parameter, and the function accepts a variable number of arguments. As a result we can now generate multiple columns at once:

select * from test_vector_types(NULL::INT, NULL::VARCHAR);
┌─────────────┬──────────────┐
│ test_vector │ test_vector2 │
│    int32    │   varchar    │
├─────────────┼──────────────┤
│ -2147483648 │ 🦆🦆🦆🦆🦆🦆 │
│  2147483647 │ goo\0se      │
│        NULLNULL         │
│ -2147483648 │ 🦆🦆🦆🦆🦆🦆 │
│ -2147483648 │ 🦆🦆🦆🦆🦆🦆 │
│ -2147483648 │ 🦆🦆🦆🦆🦆🦆 │
│  2147483647 │ goo\0se      │
│        NULLNULL         │
│           3 │ 🦆🦆🦆🦆🦆🦆 │
│           5 │ goo\0se      │
│           7NULL         │
├─────────────┴──────────────┤
│ 11 rows          2 columns │
└────────────────────────────┘

Note that the vector types are "aligned", so the first three rows are a flat vector, the next is a constant vector, then a dictionary vector and finally a sequence vector.

@Mytherin Mytherin merged commit c1530ae into duckdb:master Jun 2, 2023
@Mytherin Mytherin deleted the testallfunctions branch July 5, 2023 03:40
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.

1 participant