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 GO

admin by admin
April 23, 2023
in Big Data


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

By providing a native driver in pure GO compliant with the database/sql package, we enable a simple developer experience that API developers already know. These apps can benefit from Go’s speed as a compiled language to fetch larger amounts of data.

In this blog post, we will run through some examples of connecting to Databricks and running queries against a sample dataset.

Simple package import

With this GO driver, there’s no need to deal with ODBC/JDBC driver dependencies. To get started, simply import database/sql and Databricks SQL Driver fo GO as follows:


package main
import (
    "database/sql"
    "fmt"
    _ "github.com/databricks/databricks-sql-go"
)

Setting up connection

The connector works with SQL Warehouses as well as All Purpose Clusters. In this example, we show you how to connect to and run a query on a SQL Warehouse. To establish a connection, we import the connector and pass in connection and authentication information. You can authenticate using a Databricks personal access token (PAT) or a Microsoft Azure active directory (AAD) token.


func main() {
    dsn := "token://dapi***@host*****.databricks.com/sql/1.0/warehouses/***"
    db, err := sql.Open("databricks", dsn)
    if err != nil {
        panic(err)
    }

Querying data

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


rows, err := db.Query("SELECT trip_distance FROM samples.nyctaxi.trips")
    defer rows.Close()
    var stringVal string
    for rows.Next() {
        err := rows.Scan(&stringVal)
        if err != nil {
            panic(err)
        }
        fmt.Println(stringVal)
    }
}

Check our documentation for more examples & full API reference.

A bright future for Go developers on the lakehouse

We’re happy to announce that our GO driver is open source on Github. We welcome contributions from the community. We’re pleased to have worked with several partners while developing this driver, especially Sigma who are using this new driver to bring their powerful BI and analytics capabilities to Databricks customers.

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



Source link

Previous Post

Accelerate HiveQL with Oozie to Spark SQL migration on Amazon EMR

Next Post

16-Year-Old Data Scientist Creates R Shiny App to Champion Gender Equality in Sports Media Coverage of NCAA Women’s Basketball

Next Post

16-Year-Old Data Scientist Creates R Shiny App to Champion Gender Equality in Sports Media Coverage of NCAA Women’s Basketball

Recommended

Create small multiples in Amazon QuickSight

November 25, 2022

GPT-4 Has Arrived: Here’s What to Know

March 21, 2023

A UI That Makes You Want to Stream

March 1, 2023

Don't miss it

News

Why Roblox Picked VictoriaMetrics for Observability Data Overhaul

June 6, 2023
News

Fivetran vs Matillion: Unveiling the Ultimate Battle of ETL Tools

June 5, 2023
Big Data

3 Key AI Predictions for The Near Future + How to Use AI to Transform Your Business

June 5, 2023
Big Data

Better LLMs with Better Data using Cleanlab Studio

June 5, 2023
News

Trakstar unlocks new analytical opportunities for its HR customers with Amazon QuickSight

June 5, 2023
News

Saving Sea Turtles with SAS’s ConserVision App

June 5, 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.