-
Notifications
You must be signed in to change notification settings - Fork 13
Replace hardcoded percentages with values from a file #27
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
Open
ZuleykhaPavlichenkova-TomTom
wants to merge
46
commits into
duckdb:main
Choose a base branch
from
ZuleykhaPavlichenkova-TomTom:random-values-from-file
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
922b9af
add RandomConfigs class with default values and applied to the Genera…
ZuleykhaPavlichenkova-TomTom 88949bc
add a class for random numbers configuraion
ZuleykhaPavlichenkova-TomTom 1632858
change statement generator to work with the RandomsConfig
ZuleykhaPavlichenkova-TomTom aaac78c
rename randoms config
ZuleykhaPavlichenkova-TomTom c1506c5
mention random_nums_config files in the CMakes
ZuleykhaPavlichenkova-TomTom f602008
a json string gets parsed
ZuleykhaPavlichenkova-TomTom e08843b
parseJSONMap and initialise RandomNumsConfig with the custom values f…
ZuleykhaPavlichenkova-TomTom f629ec1
Merge remote-tracking branch 'upstream/main' into random-values-from-…
ZuleykhaPavlichenkova-TomTom fa89b25
fix paths to the reusable workflows, since they were moved to the .wo…
ZuleykhaPavlichenkova-TomTom 6751d00
Merge branch 'main' into random-values-from-file
ZuleykhaPavlichenkova-TomTom 11c5910
add randoms_config_handle to fuzzyduck
ZuleykhaPavlichenkova-TomTom 566aff3
add config file
ZuleykhaPavlichenkova-TomTom 87d6a03
FileSystem::ReadFile uses reads the file with all the new line symbol…
ZuleykhaPavlichenkova-TomTom de5cada
pass config file path as randoms_config_filepath parameter
ZuleykhaPavlichenkova-TomTom ce877c4
turn the RandomNumsConfig into an unorderdered_map<percentages_enum, …
ZuleykhaPavlichenkova-TomTom 38757a5
rename to RandomPercentagesEnum
ZuleykhaPavlichenkova-TomTom 26ba5ec
fixed missing values
ZuleykhaPavlichenkova-TomTom 7275d9a
GetDefaultConfig() instead of throwing an exception when the file wit…
ZuleykhaPavlichenkova-TomTom ad51bdd
do not declare a variable for config again
ZuleykhaPavlichenkova-TomTom 1430522
remove file handling, because it's being handled by yyjson_read_file
ZuleykhaPavlichenkova-TomTom 3d395fd
add randoms_config_filepath to scripts/run_fuzzer.py
ZuleykhaPavlichenkova-TomTom 4930d43
naive way to parse nested config.json to a map
ZuleykhaPavlichenkova-TomTom fb32a9d
config_nested.json file
ZuleykhaPavlichenkova-TomTom 73b1cf1
parseJson recursively
ZuleykhaPavlichenkova-TomTom 58d4908
a test file
ZuleykhaPavlichenkova-TomTom 2b9ae4d
clean up
ZuleykhaPavlichenkova-TomTom f8aea67
set values of missing in the config file statement types to 0
ZuleykhaPavlichenkova-TomTom 5e5e7ad
add missing quote
ZuleykhaPavlichenkova-TomTom 0ddd49c
update the config file with almost all randoms
ZuleykhaPavlichenkova-TomTom 7ada4b3
update src/include/random_nums_config.hpp to align with the config
ZuleykhaPavlichenkova-TomTom 4cfe8c4
update StringToRandomPercentagesEnum in the src/random_nums_config.cpp
ZuleykhaPavlichenkova-TomTom ea50779
config_nested.json with all the default values
ZuleykhaPavlichenkova-TomTom c3c7725
src/include/random_nums_config.hpp corrected names
ZuleykhaPavlichenkova-TomTom ebe03d5
pass config to the statement generator
ZuleykhaPavlichenkova-TomTom 5b8f652
rename some values
ZuleykhaPavlichenkova-TomTom 628f2d8
remove duplicating line
ZuleykhaPavlichenkova-TomTom 1a1ff8a
make RandomNumsConfig class
ZuleykhaPavlichenkova-TomTom ef48353
limit count of generated set operations
ZuleykhaPavlichenkova-TomTom 3cd1bfb
set percentage to setop
ZuleykhaPavlichenkova-TomTom db0645b
add more values from the config file
ZuleykhaPavlichenkova-TomTom 8e5088e
Merge branch 'main' into random-values-from-file
ZuleykhaPavlichenkova-TomTom 9991f57
merge
ZuleykhaPavlichenkova-TomTom 2fcfb78
Merge remote-tracking branch 'origin/main' into random-values-from-file
ZuleykhaPavlichenkova-TomTom f786048
some minor fixes (to make it compile again)
ZuleykhaPavlichenkova-TomTom a3ee5a2
clean up and provide required inputs to the workflow
ZuleykhaPavlichenkova-TomTom 225001e
build duckdb main
ZuleykhaPavlichenkova-TomTom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "select_percentage": "70", | ||
| "attach_percentage": "20", | ||
| "attach_use_percentage": "80", | ||
| "detach_percentage": "15", | ||
| "set_percentage": "5", | ||
| "delete_percentage": "25" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| { | ||
| "attach": { | ||
| "attach_percentage": "20", | ||
| "attach_use_percentage": "80", | ||
| "attach_read_only": "30" | ||
| }, | ||
| "detach": { | ||
| "detach_percentage": "15", | ||
| "detach_random_name": "20" | ||
| }, | ||
| "set": { | ||
| "set_percentage": "5", | ||
| "set_attached_db": "90" | ||
| }, | ||
| "delete_percentage": "25", | ||
| "select": { | ||
| "select_percentage": "70", | ||
| "select_node": { | ||
| "select_node_perc": "5", | ||
| "select_node_is_distinct_perc": "30", | ||
| "select_node_from_table_perc": "95", | ||
| "select_node_where_perc": "60", | ||
| "select_node_having_perc": "25", | ||
| "select_node_groups": { | ||
| "select_node_groups_perc": "30", | ||
| "select_node_group_by_perc": "70" | ||
| }, | ||
| "select_node_qualify_perc": "10", | ||
| "select_node_aggregate_perc": "10", | ||
| "select_node_sample": { | ||
| "select_node_sample_perc": "10", | ||
| "select_node_sample_is_perc": "50", | ||
| "select_node_sample_size": "100" | ||
| } | ||
| }, | ||
| "setop": "40", | ||
| "result_modifiers": "5", | ||
| "limit_percent_modifier": "50", | ||
| "limit_percent_modifier_limit": "30", | ||
| "limit_percent_modifier_offset": "30", | ||
| "limit_modifier_limit": "30", | ||
| "limit_modifier_offset": "30" | ||
| }, | ||
| "create": { | ||
| "create_percentage": "0", | ||
| "create_generate_select": "50", | ||
| "create_num_cols": "1000" | ||
| }, | ||
| "table_ref": { | ||
| "table_ref_base_table_ref_perc": "60", | ||
| "table_ref_expression_list_ref": "20", | ||
| "table_ref_join_ref": "40" | ||
| }, | ||
| "join_ref": { | ||
| "join_ref_cross": "10", | ||
| "join_ref_asof": "10", | ||
| "join_ref_natural": "10", | ||
| "join_ref_positional": "10", | ||
| "join_ref_general_expression": "70" | ||
| }, | ||
| "expression": { | ||
| "expression_column_ref": "50", | ||
| "expression_constant": "30", | ||
| "expression_subquery": "3" | ||
| }, | ||
| "constant_value": { | ||
| "constant_value_bigint": "50", | ||
| "constant_value_to_string": "30" | ||
| }, | ||
| "function": { | ||
| "function_aggregate": { | ||
| "function_aggregate_window_function": "10", | ||
| "function_aggregate_filter": "10", | ||
| "function_aggregate_order_by": "10", | ||
| "function_aggregate_random_expression": "10", | ||
| "function_aggregate_distinct": "10" | ||
| } | ||
| }, | ||
| "window_function": { | ||
| "window_function_partitions": "50", | ||
| "window_function_orders": "30", | ||
| "window_function_ignore_nulls": "30", | ||
| "window_function_filter_expr": "30", | ||
| "window_function_result_offset": "30", | ||
| "window_function_result_default": "30" | ||
| }, | ||
| "star": { | ||
| "star_relation_name": "10", | ||
| "star_column_name_exclude_list": "20", | ||
| "star_column_name_replace_list": "20", | ||
| "star_column_name": "20", | ||
| "star_columns": { | ||
| "star_columns_true": "50", | ||
| "star_columns_true_lambda": "50" | ||
| } | ||
| }, | ||
| "relational_name": { | ||
| "relational_name_choose_current": "80" | ||
| }, | ||
| "column_names": { | ||
| "column_names_choose_current": "80" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| // ===----------------------------------------------------------------------===// | ||
| // DuckDB | ||
|
|
||
| // random_nums_config.hpp | ||
|
|
||
|
|
||
| // ===----------------------------------------------------------------------===// | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "duckdb.hpp" | ||
| #include "yyjson.hpp" | ||
|
|
||
| namespace duckdb { | ||
|
|
||
| enum class RandomPercentagesEnum : idx_t { | ||
| // ---------------------------------- | ||
| // Generate Attach Percentages | ||
| // ---------------------------------- | ||
| ATTACH = 0, | ||
| ATTACH_USE = 1, | ||
| ATTACH_READ_ONLY = 2, | ||
| // ---------------------------------- | ||
| // Generate Detach Percentages | ||
| // ---------------------------------- | ||
| DETACH = 3, | ||
| DETACH_RANDOM_NAME = 4, | ||
| // ---------------------------------- | ||
| // Generate Set Percentages | ||
| // ---------------------------------- | ||
| SET = 5, | ||
| SET_ATTACHED_DB = 6, | ||
| // ---------------------------------- | ||
| // Generate Select Percentages | ||
| // ---------------------------------- | ||
| DELETE = 7, | ||
|
|
||
| // ---------------------------------- | ||
| // Generate Select Percentages | ||
| // ---------------------------------- | ||
| SELECT = 8, | ||
| SELECT_NODE = 9, | ||
| SELECT_NODE_IS_DISTINCT = 10, | ||
| SELECT_NODE_FROM_TABLE = 11, | ||
| SELECT_NODE_WHERE = 12, | ||
| SELECT_NODE_HAVING = 13, | ||
| SELECT_NODE_GROUPS = 14, | ||
| SELECT_NODE_GROUP_BY = 15, | ||
| SELECT_NODE_QUALIFY = 16, | ||
| SELECT_NODE_AGGREGATE = 17, | ||
| SELECT_NODE_SAMPLE = 18, | ||
| SELECT_NODE_SAMPLE_IS_PERC = 19, | ||
| SELECT_NODE_SAMPLE_SIZE = 20, | ||
| SETOP = 21, | ||
| RESULT_MODIFIERS = 22, | ||
| LIMIT_PERCENT_MODIFIER = 23, | ||
| LIMIT_PERCENT_MODIFIER_LIMIT = 24, | ||
| LIMIT_PERCENT_MODIFIER_OFFSET = 25, | ||
| LIMIT_MODIFIER_LIMIT = 26, | ||
| LIMIT_MODIFIER_OFFSET = 27, | ||
|
|
||
| // ---------------------------------- | ||
| // Generate Create Percentages | ||
| // ---------------------------------- | ||
| CREATE = 28, | ||
| CREATE_GENERATE_SELECT = 29, | ||
| CREATE_NUM_COLS = 30, | ||
| // ----------------------------------- | ||
| // Generate Table Ref Percentages | ||
| // ----------------------------------- | ||
| TABLE_REF_BASE_TABLE_REF_PERC = 31, | ||
| TABLE_REF_EXPRESSION_LIST_REF = 32, | ||
| TABLE_REF_JOIN_REF = 33, | ||
|
|
||
| // ----------------------------------- | ||
| // Generate Join Ref Percentages | ||
| // ----------------------------------- | ||
| JOIN_REF_CROSS = 34, | ||
| JOIN_REF_ASOF = 35, | ||
| JOIN_REF_NATURAL = 36, | ||
| JOIN_REF_POSITIONAL = 37, | ||
| JOIN_REF_GENERAL_EXPRESSION = 38, | ||
|
|
||
| // ----------------------------------- | ||
| // Generate Expression Percentages | ||
| // ----------------------------------- | ||
| EXPRESSION_COLUMN_REF = 39, | ||
| EXPRESSION_CONSTANT = 40, | ||
| EXPRESSION_SUBQUERY = 41, | ||
|
|
||
| // ----------------------------------- | ||
| // Generate Constant Value Percentages | ||
| // ----------------------------------- | ||
| CONSTANT_VALUE_BIGINT = 42, | ||
| CONSTANT_VALUE_TO_STRING = 43, | ||
|
|
||
| // ----------------------------------- | ||
| // Generate Function Percentages | ||
| // ----------------------------------- | ||
| FUNCTION_AGGREGATE_WINDOW_FUNCTION = 44, | ||
| FUNCTION_AGGREGATE_ORDER_BY = 45, | ||
| FUNCTION_AGGREGATE_FILTER = 60, | ||
| FUNCTION_AGGREGATE_DISTINCT = 46, | ||
| FUNCTION_AGGREGATE_RANDOM_EXPRESSION = 47, | ||
|
|
||
| // ----------------------------------- | ||
| // Generate Window Function Percentages | ||
| // ----------------------------------- | ||
| WINDOW_FUNCTION_PARTITIONS = 48, | ||
| WINDOW_FUNCTION_ORDERS = 49, | ||
| WINDOW_FUNCTION_FILTER_EXPRESSION = 61, | ||
| WINDOW_FUNCTION_IGNORE_NULLS = 50, | ||
| WINDOW_FUNCTION_RESULT_OFFSET = 51, | ||
| WINDOW_FUNCTION_RESULT_DEFAULT = 52, | ||
|
|
||
| // ----------------------------------- | ||
| // Generate Star Percentages | ||
| // ----------------------------------- | ||
| STAR_RELATION_NAME = 53, | ||
| STAR_COLUMN_NAME = 54, | ||
| STAR_COLUMN_NAME_EXCLUDE_LIST = 55, | ||
| STAR_COLUMN_NAME_REPLACE_LIST = 62, | ||
| STAR_COLUMNS_TRUE = 56, | ||
| STAR_COLUMNS_TRUE_LAMBDA = 57, | ||
|
|
||
| RELATIONAL_NAME_CHOOSE_CURRENT = 58, | ||
| COLUMN_NAMES_CHOOSE_CURRENT = 59, | ||
|
|
||
| COUNT | ||
|
|
||
| }; | ||
|
|
||
| class RandomNumsConfig { | ||
| public: | ||
| RandomNumsConfig(); | ||
| RandomNumsConfig(const char *config_file_path); | ||
| ~RandomNumsConfig(); | ||
|
|
||
| RandomPercentagesEnum percentages_selector; | ||
|
|
||
| unordered_map<RandomPercentagesEnum, idx_t> GetDefaultConfig(); | ||
| unordered_map<RandomPercentagesEnum, idx_t> GetConfigFromFile(const char *json_string); | ||
| string RandomPercentagesEnumToString(RandomPercentagesEnum type); | ||
|
|
||
| }; | ||
|
|
||
| }// namespace duckdb | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.