Big Data News Hubb
Advertisement
  • Home
  • Big Data
  • News
  • Contact us
No Result
View All Result
  • Home
  • Big Data
  • News
  • Contact us
No Result
View All Result
Big Data News Hubb
No Result
View All Result
Home Big Data

Building Data Applications on the Lakehouse With the Databricks SQL Driver for Node.js

admin by admin
April 22, 2023
in Big Data


We are excited to announce the general availability of the Databricks SQL Driver for NodeJS. This follows the recent general availability of Databricks SQL Driver for GO and the earlier Databricks SQL Connector for Python. Node.js developers can now easily build data applications on the lakehouse in pure Javascript or TypeScript.

The NodeJS driver offers simple installation and a flexible interface that makes it easy to query data. It also automatically converts data types between Databricks SQL and Node.js clients, removing the need for boilerplate code.

This blog post will use examples of connecting to Databricks and running queries against a sample data set.

Simple installation from npm

With this Node.js driver, there’s no need to deal with ODBC/JDBC driver dependencies. Installation is through npm, which means you can include this connector in your application and use it for CI/CD. On NodeJS 14 or newer:


npm i @databricks/sql

Setting up connection

The connector works with SQL warehouses and All Purpose Clusters. This example shows you how to connect to and run a query on a SQL Warehouse. We import the connector and pass in connection and authentication information to establish a connection. You can authenticate using a Databricks personal access token (PAT) or a Microsoft Azure active directory (AAD) token (to be released shortly).


const { DBSQLClient } = require('@databricks/sql');

const client = new DBSQLClient();

client
  .connect({
    host: '********.databricks.com',
    path: '/sql/1.0/endpoints/****************',
    token: 'dapi********************************',
  })
  .then(async (client) => {
    const session = await client.openSession();

Querying data

The following example retrieves a list of trips from the NYC taxi sample dataset and prints the result to the console.


const queryOperation = await session.executeStatement('SELECT trip_distance FROM samples.nyctaxi.trips', { runAsync: true });
    const result = await queryOperation.fetchAll();
    await queryOperation.close();

    console.table(result);

    await session.close();
    await client.close();
  })
  .catch((error) => {
    console.log(error);
  });

Our documentation includes examples in Javascript and TypeScript to help you get started, as well as the full API reference.

A bright future for Node.js developers on the lakehouse

We’re happy to announce that our Node.js driver is open source on Github. We welcome contributions from the community. We’re already seeing our partners, such as Qlik Analytics, use the Node connector in their products.

We’re even more excited about what our customers will build with the Databricks SQL Driver for Node.js! Please try out the driver and let us know your thoughts on Github. We would love to hear what you would like us to support.



Source link

Previous Post

Automate discovery of data relationships using ML and Amazon Neptune graph technology

Next Post

Scale Zeitgeist: AI Readiness Report

Next Post

Scale Zeitgeist: AI Readiness Report

Recommended

New Survey Indicates Use of Alternative Data in Investment Community Shows No Signs of Slowing

December 9, 2022

Data Quality Is Getting Worse, Monte Carlo Says

May 7, 2023

PingCAP Empowers Open Source Community with New GitHub Data Explorer Tool

May 3, 2023

Don't miss it

News

Snowflake Bolsters Data Cloud Search Capabilities with Neeva Acquisition

June 3, 2023
News

From Small To Big: Tips On Growing Your Business Successfully

June 2, 2023
Big Data

AI Empowers Microfinance: Revolutionizing Fraud Detection

June 2, 2023
Big Data

Handling “Right to be Forgotten” in GDPR and CCPA using Delta Live Tables (DLT)

June 2, 2023
News

Real-time inference using deep learning within Amazon Kinesis Data Analytics for Apache Flink

June 2, 2023
News

GDPR Celebrates Fifth Birthday, Meta Fined $1.3 Billion

June 2, 2023
big-data-footer-white

© Big Data News Hubb All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy and Terms & Conditions.

Navigate Site

  • Home
  • Big Data
  • News
  • Contact us

Newsletter Sign Up

No Result
View All Result
  • Home
  • Big Data
  • News
  • Contact us

© 2022 Big Data News Hubb All rights reserved.