@gscdump/engine 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -132,9 +132,9 @@ function resolveToSQLOptimized(state, options) {
|
|
|
132
132
|
}
|
|
133
133
|
if (hasDate) cteSelect.push(adapter.dateColRef(tableKey));
|
|
134
134
|
const t = schema[tableKey];
|
|
135
|
-
cteSelect.push(sql`SUM(${t.clicks}) as clicks`);
|
|
136
|
-
cteSelect.push(sql`SUM(${t.impressions}) as impressions`);
|
|
137
|
-
cteSelect.push(sql`SUM(${t.sum_position}) as sum_position`);
|
|
135
|
+
cteSelect.push(sql`CAST(SUM(${t.clicks}) AS DOUBLE) as clicks`);
|
|
136
|
+
cteSelect.push(sql`CAST(SUM(${t.impressions}) AS DOUBLE) as impressions`);
|
|
137
|
+
cteSelect.push(sql`CAST(SUM(${t.sum_position}) AS DOUBLE) as sum_position`);
|
|
138
138
|
const groupByExprs = groupByDims.map((d) => adapter.dimExprSql(d, tableKey));
|
|
139
139
|
if (hasDate) groupByExprs.push(adapter.dateColRef(tableKey));
|
|
140
140
|
const outerSelect = [];
|
|
@@ -144,11 +144,11 @@ function resolveToSQLOptimized(state, options) {
|
|
|
144
144
|
for (const m of metrics) switch (m) {
|
|
145
145
|
case "clicks":
|
|
146
146
|
outerSelect.push(sql.raw("clicks"));
|
|
147
|
-
outerTotals.push(sql.raw("SUM(clicks) OVER() as totalClicks"));
|
|
147
|
+
outerTotals.push(sql.raw("CAST(SUM(clicks) OVER() AS DOUBLE) as totalClicks"));
|
|
148
148
|
break;
|
|
149
149
|
case "impressions":
|
|
150
150
|
outerSelect.push(sql.raw("impressions"));
|
|
151
|
-
outerTotals.push(sql.raw("SUM(impressions) OVER() as totalImpressions"));
|
|
151
|
+
outerTotals.push(sql.raw("CAST(SUM(impressions) OVER() AS DOUBLE) as totalImpressions"));
|
|
152
152
|
break;
|
|
153
153
|
case "ctr":
|
|
154
154
|
outerSelect.push(sql.raw("CAST(clicks AS REAL) / NULLIF(impressions, 0) as ctr"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/engine",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.2",
|
|
5
5
|
"description": "Append-only Parquet/DuckDB storage engine + planner + adapters for the gscdump pipeline. Node + edge runtimes; opt-in heavy peers.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"dependencies": {
|
|
160
160
|
"drizzle-orm": "^0.45.2",
|
|
161
161
|
"proper-lockfile": "^4.1.2",
|
|
162
|
-
"gscdump": "0.9.
|
|
162
|
+
"gscdump": "0.9.2"
|
|
163
163
|
},
|
|
164
164
|
"devDependencies": {
|
|
165
165
|
"@duckdb/duckdb-wasm": "^1.32.0",
|