Comments (3)
Thanks! I tested this and the problem is that the return value of the query is already parsed. Instead of calling JSON.parse
, simply use the returned q
array.
If using a DuckDB server (socket
connector), the result will be sent back as a JSON string and parsed internally. Meanwhile, DuckDB-WASM (wasm
connector) only produces Arrow tables, so when json
is requested the Arrow table is coerced to a JS-Array-of-Objects compatible array.
from mosaic.
Thanks for reporting the issue. Can you share a basic table CREATE and/or INSERT query with data that replicates the issue? (A single row table should be fine!) Then we can test directly on our end and see where in the pipeline the bug may arise.
from mosaic.
here you go:
vg.coordinator().exec('CREATE TABLE test AS SELECT \'^(?P<DD>0[1-9]|[1-2]\\d|3[0-1])/\' as teststring' );
vg.coordinator().query("SELECT teststring from test;", {type: "json", cache: false})
.then((q) => {
console.log(q.toString());
const t = JSON.parse(q);
console.log(t);
});
results in:
{"teststring": "^(?P<DD>0[1-9]|[1-2]\d|3[0-1])/"}
VM262:1 Uncaught (in promise) SyntaxError: Bad escaped character in JSON at position 37
at JSON.parse (<anonymous>)
at index.html:57:19
```
from mosaic.
Related Issues (20)
- Allow for Menu to select a sql expression
- Documentation request: how to create a custom client HOT 2
- Jupyter: Geospatial integration with Lonboard
- Add TypeScript Support HOT 5
- mosaic jupyter widget example typo? HOT 1
- Feature: Support for a Tip mark / Tooltip support HOT 1
- Mosaic-widget bug with Windows OS HOT 3
- Heatmap not working HOT 2
- Spec astToDOM should respect predefined params
- Disable activation of charts while the mouse is pressed HOT 2
- Query that filters across two tables HOT 3
- PanZoom not working with RasterMark HOT 5
- Tooltips+Toggle Usability Problem - Proposed Resolution Provided HOT 2
- table bugs on crossfilter interactions after scrolling
- Add mosaic plots HOT 2
- Type mismatch between Field and Ref
- React hooks for Mosaic HOT 1
- Idea - enable multiple backends via Substrait HOT 1
- TypeError when dynamically setting the x-channel HOT 1
- Creating a table should automatically escape the name with quotes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosaic.