Skip to content

Commit a5bae69

Browse files
committed
feat(mysql-driver): loadPreAggregationWithoutMetaLock option
1 parent 971ae1b commit a5bae69

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/cubejs-mysql-driver/driver/MySqlDriver.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ class MySqlDriver extends BaseDriver {
124124
return GenericTypeToMySql[columnType] || super.fromGenericType(columnType);
125125
}
126126

127+
async loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, tx) {
128+
if (this.config.loadPreAggregationWithoutMetaLock) {
129+
console.log(`${loadSql} LIMIT 0`);
130+
await this.query(`${loadSql} LIMIT 0`, params);
131+
console.log(loadSql.replace(/^CREATE TABLE (\S+) AS/i, 'INSERT INTO $1'));
132+
return this.query(loadSql.replace(/^CREATE TABLE (\S+) AS/i, 'INSERT INTO $1'), params);
133+
}
134+
return super.loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, tx);
135+
}
136+
127137
toColumnValue(value, genericType) {
128138
if (genericType === 'timestamp' && typeof value === 'string') {
129139
return value && value.replace('Z', '');

0 commit comments

Comments
 (0)