@rapidsai/sql
v22.12.1
Published
NVIDIA RAPIDS In-memory GPU accelerated SQL Queries
Downloads
5
Keywords
Readme
node-rapids GPU accelerated SQL engine
Installation
npm install @rapidsai/sql
About
These js bindings allow for GPU accelerated SQL queries.
For example, the following snippet creates a DataFrame, then uses our SQL engine to select and query a DataFrame using the SQLContext
module.
var { Series, DataFrame, Int32 } = require("@rapidsai/cudf");
var { SQLContext } = require("@rapidsai/sql");
var a = Series.new({type: new Int32(), data: [1, 2, 3]});
var b = Series.new({type: new Int32(), data: [4, 5, 6]});
var df = new DataFrame({'a': a, 'b': b});
var sqlContext = new SQLContext();
sqlContext.createDataFrameTable('test_table', df);
await sqlContext.sql('SELECT a FROM test_table').result(); // [1, 2, 3]
We have also provided the SQLCluster
module which allows one to run SQL queries on multiple GPUs.
var { Series, DataFrame } = require("@rapidsai/cudf");
var { SQLCluster } = require("@rapidsai/sql");
var a = Series.new(['foo', 'bar']);
var df = new DataFrame({'a': a});
var sqlCluster = await SQLCluster.init({numWorkers: 2});
await sqlCluster.createDataFrameTable('test_table', df);
await sqlCluster.sql('SELECT a FROM test_table WHERE a LIKE \'%foo%\''); // ['foo']
For detailed SQL API, follow our API Documentation.