@malloydata/malloy 0.0.142 → 0.0.143-dev240416173709

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.
@@ -23,6 +23,7 @@ export declare class DuckDBDialect extends Dialect {
23
23
  quoteTablePath(tableName: string): string;
24
24
  sqlGroupSetTable(groupSetCount: number): string;
25
25
  sqlAnyValue(groupSet: number, fieldName: string): string;
26
+ sqlLiteralNumber(literal: string): string;
26
27
  mapFields(fieldList: DialectFieldList): string;
27
28
  sqlAggregateTurtle(groupSet: number, fieldList: DialectFieldList, orderBy: string | undefined, limit: number | undefined): string;
28
29
  sqlAnyValueTurtle(groupSet: number, fieldList: DialectFieldList): string;
@@ -84,6 +84,13 @@ class DuckDBDialect extends dialect_1.Dialect {
84
84
  sqlAnyValue(groupSet, fieldName) {
85
85
  return `FIRST(${fieldName}) FILTER (WHERE ${fieldName} IS NOT NULL)`;
86
86
  }
87
+ // DuckDB WASM has an issue with returning invalid DecimalBigNum
88
+ // values unless we explicitly cast to DOUBLE
89
+ sqlLiteralNumber(literal) {
90
+ return literal.includes('.')
91
+ ? `${literal}::${this.defaultNumberType}`
92
+ : literal;
93
+ }
87
94
  mapFields(fieldList) {
88
95
  return fieldList.join(', ');
89
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.142",
3
+ "version": "0.0.143-dev240416173709",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",