Skip to content

Commit

Permalink
mention random_nums_config files in the CMakes
Browse files Browse the repository at this point in the history
  • Loading branch information
hmeriann committed Sep 4, 2024
1 parent aaac78c commit c1506c5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 27 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_subdirectory(src/third_party/sqlsmith)
set(EXTENSION_SOURCES src/sqlsmith_extension.cpp
src/statement_generator.cpp
src/statement_simplifier.cpp
src/random_nums_config.cpp
src/fuzzyduck.cpp ${EXTENSION_OBJECT_FILES})

build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include_directories(third_party/sqlsmith/include)
add_subdirectory(third_party)

set(SQLSMITH_SOURCES
sqlsmith_extension.cpp statement_generator.cpp statement_simplifier.cpp
sqlsmith_extension.cpp statement_generator.cpp statement_simplifier.cpp random_nums_config.cpp
fuzzyduck.cpp ${SQLSMITH_OBJECT_FILES})

build_static_extension(sqlsmith ${SQLSMITH_SOURCES})
Expand Down
29 changes: 11 additions & 18 deletions src/include/random_nums_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,23 @@
namespace duckdb {

class RandomNumsConfig {
private:

idx_t select_percentage = 60;
idx_t attach_percentage = 40;
idx_t attach_use_percentage = 50;
idx_t detach_percentage = 60;
idx_t set_percentage = 30;
idx_t delete_percentage = 40;

public:
RandomNumsConfig() {

};
idx_t select_percentage;
idx_t attach_percentage;
idx_t attach_use_percentage;
idx_t detach_percentage;
idx_t set_percentage;
idx_t delete_percentage;

RandomNumsConfig();
~RandomNumsConfig();

// is it better to return an object initialised with fetched/default params?
// read file and update default values
void getConfigFromFile(duckdb_string_t file_path) {

}

void GetConfigFromFile(duckdb_string_t file_path);
// set default values
void GetDefaultConfig() {

}
void GetDefaultConfig();

};

Expand Down
2 changes: 0 additions & 2 deletions src/include/statement_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "duckdb.hpp"
#include "duckdb/parser/parsed_data/detach_info.hpp"
#include "duckdb/parser/query_node.hpp"
#include "src/include/random_nums_config.hpp"

#define TESTING_DIRECTORY_NAME "duckdb_unittest_tempdir"

Expand Down Expand Up @@ -41,7 +40,6 @@ class StatementGenerator {
friend class ExpressionDepthChecker;
friend class AggregateChecker;
friend class WindowChecker;
RandomNumsConfig random_nums_config;

public:
StatementGenerator(ClientContext &context);
Expand Down
26 changes: 20 additions & 6 deletions src/random_nums_config.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
#include "random_nums_config.hpp"

namespace duckdb {
void getConfigFromFile(duckdb_string_t file_path) {

RandomNumsConfig::RandomNumsConfig() {

}

}
RandomNumsConfig::~RandomNumsConfig() {
}

// set default values
void GetDefaultConfig() {

}

void RandomNumsConfig::GetConfigFromFile(duckdb_string_t file_path) {

}

// set default values
void RandomNumsConfig::GetDefaultConfig() {
idx_t select_percentage = 60;
idx_t attach_percentage = 40;
idx_t attach_use_percentage = 50;
idx_t detach_percentage = 60;
idx_t set_percentage = 30;
idx_t delete_percentage = 40;
}
}
1 change: 1 addition & 0 deletions src/statement_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "duckdb/parser/statement/set_statement.hpp"
#include "duckdb/parser/statement/update_statement.hpp"
#include "duckdb/parser/tableref/list.hpp"
#include "random_nums_config.hpp"

namespace duckdb {

Expand Down

0 comments on commit c1506c5

Please sign in to comment.