0.0.8 • Published 5 months ago

athena-view v0.0.8

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

Athena View Construct

This is a Construct Library that makes it easy to create Views in Amazon Athena.

Install

npm install athena-view
# OR
yarn add athena-view

Get Started

import * as glue from "@aws-cdk/aws-glue-alpha";
import { View } from "athena-view";

const database = new glue.Database(this, "Database");
const orderTable = new glue.S3Table(this, "OrderTable", {
  database,
  columns: [
    { name: "orderkey", type: glue.Schema.STRING },
    { name: "orderstatus", type: glue.Schema.STRING },
    { name: "totalprice", type: glue.Schema.BIG_INT },
    { name: "orderdate", type: glue.Schema.DATE },
  ],
  dataFormat: glue.DataFormat.PARQUET,
});
new View(this, "OrdersByDate", {
  database,
  columns: [
    { name: "orderdate", type: glue.Schema.STRING },
    { name: "price", type: glue.Schema.BIG_INT },
  ],
  queryString: `SELECT orderdate, sum(totalprice) AS price FROM ${orderTable.tableName} GROUP BY orderdate;`,
});

Side note

The actual state of a view in Amazon Athena is an AWS Glue table. This Construct Library is a Glue Table L2.5 Construct specialized for Athena Views. If you want to customize it in detail, please refer to the GitHub source. https://github.com/WinterYukky/athena-view

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

7 months ago

0.0.2

8 months ago

0.0.1

8 months ago

0.0.0

8 months ago