DuckDB reports DECIMAL(17,14) as column type, but mosaic expects DECIMAL => Unsupported type error #228
-
When trying to plot my data I get the following error:
Using DuckDB's shell I recreated the table and get this:
And this is the code giving the error: export function jsType(type) {
switch (type) {
case 'BIGINT':
case 'HUGEINT':
case 'INTEGER':
case 'SMALLINT':
case 'TINYINT':
case 'UBIGINT':
case 'UINTEGER':
case 'USMALLINT':
case 'UTINYINT': // integers
case 'DOUBLE':
case 'FLOAT':
case 'REAL':
case 'DECIMAL':
return 'number';
case 'DATE':
case 'TIMESTAMP':
case 'TIMESTAMPTZ':
case 'TIME':
return 'date';
case 'BOOLEAN':
return 'boolean';
case 'VARCHAR':
case 'UUID':
return 'string';
case 'LIST':
return 'array';
case 'BLOB':
case 'STRUCT':
case 'MAP':
return 'object';
default:
throw new Error(`Unsupported type: ${type}`);
}
} So, there are several angles:
How can I solve this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Some more information: This is the data in DuckDB:
I loaded the data via |
Beta Was this translation helpful? Give feedback.
-
Previously Mosaic was unable to handle Decimal type values, largely because of incomplete decoding support within the Apache Arrow JS lib. But Mosaic / vgplot v0.7.0 now supports decoding Decimal values to JS numbers! Though potentially lossy with high digit counts (JS numbers may have floating point discretization error), this allows decimal values to be processed and visualized. |
Beta Was this translation helpful? Give feedback.
Previously Mosaic was unable to handle Decimal type values, largely because of incomplete decoding support within the Apache Arrow JS lib.
But Mosaic / vgplot v0.7.0 now supports decoding Decimal values to JS numbers! Though potentially lossy with high digit counts (JS numbers may have floating point discretization error), this allows decimal values to be processed and visualized.