@malloydata/malloy 0.0.196-dev241008013446 → 0.0.196-dev241009134502
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.
package/dist/dialect/dialect.js
CHANGED
|
@@ -63,7 +63,7 @@ class Dialect {
|
|
|
63
63
|
this.cantPartitionWindowFunctionsOnExpressions = false;
|
|
64
64
|
// Snowflake can't yet support pipelines in nested views.
|
|
65
65
|
this.supportsPipelinesInViews = true;
|
|
66
|
-
// Some dialects don't supporrt arrays
|
|
66
|
+
// Some dialects don't supporrt arrays (mysql)
|
|
67
67
|
this.supportsArraysInData = true;
|
|
68
68
|
// can read some version of ga_sample
|
|
69
69
|
this.readsNestedData = true;
|
|
@@ -46,6 +46,8 @@ exports.MYSQL_MALLOY_STANDARD_OVERLOADS = {
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
byte_length: { sql: '(LENGTH(CAST(${value} AS VARBINARY)))' },
|
|
49
|
-
chr: {
|
|
49
|
+
chr: {
|
|
50
|
+
sql: "CASE WHEN ${value} = 0 THEN '' ELSE CHAR(${value} USING latin1) END",
|
|
51
|
+
},
|
|
50
52
|
};
|
|
51
53
|
//# sourceMappingURL=function_overrides.js.map
|
|
@@ -27,6 +27,7 @@ export declare class MySQLDialect extends Dialect {
|
|
|
27
27
|
supportsPipelinesInViews: boolean;
|
|
28
28
|
readsNestedData: boolean;
|
|
29
29
|
supportsComplexFilteredSources: boolean;
|
|
30
|
+
supportsArraysInData: boolean;
|
|
30
31
|
malloyTypeToSQLType(malloyType: AtomicTypeDef): string;
|
|
31
32
|
sqlTypeToMalloyType(sqlType: string): LeafAtomicDef;
|
|
32
33
|
quoteTablePath(tablePath: string): string;
|
|
@@ -103,6 +103,7 @@ class MySQLDialect extends dialect_1.Dialect {
|
|
|
103
103
|
this.supportsPipelinesInViews = false;
|
|
104
104
|
this.readsNestedData = false;
|
|
105
105
|
this.supportsComplexFilteredSources = false;
|
|
106
|
+
this.supportsArraysInData = false;
|
|
106
107
|
}
|
|
107
108
|
malloyTypeToSQLType(malloyType) {
|
|
108
109
|
if (malloyType.type === 'number') {
|
|
@@ -153,7 +154,7 @@ class MySQLDialect extends dialect_1.Dialect {
|
|
|
153
154
|
gc = `SUBSTRING_INDEX(${gc}, '${separator}', ${limit})`;
|
|
154
155
|
gc = `REPLACE(${gc},'${separator}',',')`;
|
|
155
156
|
}
|
|
156
|
-
gc = `JSON_EXTRACT(CONCAT('[',${gc},']'),'$')`;
|
|
157
|
+
gc = `COALESCE(JSON_EXTRACT(CONCAT('[',${gc},']'),'$'),JSON_ARRAY())`;
|
|
157
158
|
return gc;
|
|
158
159
|
}
|
|
159
160
|
sqlAnyValueTurtle(groupSet, fieldList) {
|
|
@@ -175,7 +176,7 @@ class MySQLDialect extends dialect_1.Dialect {
|
|
|
175
176
|
else if (t === 'string') {
|
|
176
177
|
return 'TEXT';
|
|
177
178
|
}
|
|
178
|
-
else if (t === 'struct') {
|
|
179
|
+
else if (t === 'struct' || t === 'array' || t === 'record') {
|
|
179
180
|
return 'JSON';
|
|
180
181
|
}
|
|
181
182
|
else
|