Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-athena

Package Overview
Dependencies
Maintainers
5
Versions
429
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-athena

AWS SDK for JavaScript Athena Client for Node.js, Browser and React Native

  • 3.709.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @aws-sdk/client-athena?

@aws-sdk/client-athena is a part of the AWS SDK for JavaScript, which allows developers to interact with Amazon Athena, a serverless interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL.

What are @aws-sdk/client-athena's main functionalities?

StartQueryExecution

This feature allows you to start a new query execution in Amazon Athena. The code sample demonstrates how to initiate a query execution and log the Query Execution ID.

const { AthenaClient, StartQueryExecutionCommand } = require('@aws-sdk/client-athena');

const client = new AthenaClient({ region: 'us-west-2' });

const params = {
  QueryString: 'SELECT * FROM sample_table;',
  QueryExecutionContext: { Database: 'sample_database' },
  ResultConfiguration: { OutputLocation: 's3://your-output-bucket/' }
};

const run = async () => {
  try {
    const data = await client.send(new StartQueryExecutionCommand(params));
    console.log('Query Execution ID:', data.QueryExecutionId);
  } catch (err) {
    console.error(err);
  }
};

run();

GetQueryExecution

This feature allows you to get the status of a query execution. The code sample demonstrates how to retrieve and log the status of a specific query execution.

const { AthenaClient, GetQueryExecutionCommand } = require('@aws-sdk/client-athena');

const client = new AthenaClient({ region: 'us-west-2' });

const params = { QueryExecutionId: 'your-query-execution-id' };

const run = async () => {
  try {
    const data = await client.send(new GetQueryExecutionCommand(params));
    console.log('Query Execution Status:', data.QueryExecution.Status.State);
  } catch (err) {
    console.error(err);
  }
};

run();

GetQueryResults

This feature allows you to retrieve the results of a query execution. The code sample demonstrates how to fetch and log the results of a specific query execution.

const { AthenaClient, GetQueryResultsCommand } = require('@aws-sdk/client-athena');

const client = new AthenaClient({ region: 'us-west-2' });

const params = { QueryExecutionId: 'your-query-execution-id' };

const run = async () => {
  try {
    const data = await client.send(new GetQueryResultsCommand(params));
    console.log('Query Results:', data.ResultSet.Rows);
  } catch (err) {
    console.error(err);
  }
};

run();

Other packages similar to @aws-sdk/client-athena

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc