@rapidsai/sql
TypeScript icon, indicating that this package has built-in type declarations

22.12.1 • Public • Published

  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.

Readme

Keywords

none

Package Sidebar

Install

npm i @rapidsai/sql

Weekly Downloads

5

Version

22.12.1

License

Apache-2.0

Unpacked Size

219 kB

Total Files

43

Last publish

Collaborators

  • rapidsai-owner
  • raydouglass
  • jacobtomlinson