You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a continuation of the effort for the workload generator which was worked on as an intern project.
This PR addresses multiple issues and enhancements as mentioned:
Columns were not identified properly in case there were Joins because only 1 table name was considered from a statement.
e.g. SELECT o.id, r.c2, r.c3 FROM orders o JOIN ref_data r ON o.acc_no = r.acc_no JOIN ref_data r2 ON o.acc_no = r2.acc_no WHERE r.c2 = _
Columns with table_alias.column_name is not handled as table aliases were not maintained.
e.g. SELECT o.id, r.c2 FROM orders o, ref_data r WHERE o.acc_no = r.acc_no AND o.amount > _ AND r.acc_no = _ OR o.acc_no = _;
table names prefixed with database name in it were not parsed correctly. In this case, the database_name column in the crdb_internal.node_statement_statistics.txt file, can have a different database name and not the actual database name.
e.g. select a,b,c from db_1.table_name.
If a query is run from the current database scope, the queries are marked as the current database even if the query is run for another database.
e.g. SQL> use db1;
SQL> select * from db2.table_in_db2;
The query for db is marked under the database name db1 in the crdb_internal.node_statement_statistics.txt file. This causes an issue as unsupported queries also get added for run.
Currently, the workload cannot be re-run as the last value of a sequence column is not maintained from the previous run. So, we had to fresh import the data before each run. Now, the last_value is stored in the YAML so that it can be reused in the next run.
There are some additional cleanup changes:
Use references instead of pass by value
The block for each table was a list, which was unnecessary.
checkIfAllPkAreFk had a bug where the function used to return true if there were no primary key in the query.
Ensure that we use import instead of insert during dataload. This is fixed by initializing the workload schema in tha Tables call, which ensures that the "support fixtures" check is set to true.
Fixes: CRDB-51572
Epic: None
0 commit comments