Skip to content

Commit 3800305

Browse files
committed
fix HLL_SNOWFLAKE serialization
1 parent 15a5a5a commit 3800305

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,21 @@ const hydrators: HydrationConfiguration[] = [
101101
}
102102
);
103103
},
104+
},
105+
{
106+
types: ['object'], // Workaround for HLL_SNOWFLAKE
107+
toValue: () => (value) => {
108+
if (!value) {
109+
return null;
110+
}
111+
112+
return JSON.stringify(value);
113+
},
104114
}
105115
];
106116

107117
const SnowflakeToGenericType: Record<string, GenericDataBaseType> = {
108-
// It's a limitation for now, because anyway we dont work with JSON objects in Cube Store.
118+
// It's a limitation for now, because anyway we don't work with JSON objects in Cube Store.
109119
object: 'HLL_SNOWFLAKE',
110120
number: 'decimal',
111121
timestamp_ntz: 'timestamp'

0 commit comments

Comments
 (0)