rapidsai / node

GPU-accelerated data science and visualization in node

Home Page:https://rapidsai.github.io/node/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEA] Add bindings to Series getJSONObject query

trxcllnt opened this issue · comments

Given the prevalence of JSON in JavaScript, it'd be awesome if we added bindings to the cudf::get_json_object() method.

This would allow us to query a StringSeries of JSON lines for JSON paths:

import { Series } from '@rapidsai/cudf';

const lines = Series.new([
 {foo: {bar: "baz"}},
 {foo: {baz: "bar"}},
].map(JSON.stringify))

console.log([...lines.getJSONObject(`foo`)].map(JSON.parse)) // [{ "bar": "baz" }, { "baz": "bar" }]

console.log([...lines.getJSONObject(`foo.bar`)]) // ["baz", ""]