-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
80 additions
and
3,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,5 @@ jspm_packages | |
.node_repl_history | ||
|
||
.DS_Store | ||
index.js | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- '9' | ||
- '8' | ||
- '7' | ||
- '6' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as aws from 'aws-sdk'; | ||
import { AthenaClient, AthenaClientConfig } from './lib/client'; | ||
export declare function createClient(clientConfig: AthenaClientConfig, awsConfig: aws.Config): AthenaClient; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Athena } from 'aws-sdk'; | ||
import { AthenaRequest, AthenaRequestConfig } from './request'; | ||
import { AthenaStream, AthenaStreamConfig } from './stream'; | ||
export interface AthenaExecutionResult<T> { | ||
records: T[]; | ||
queryExecution: Athena.QueryExecution; | ||
} | ||
export interface AthenaExecutionSelect<T> { | ||
toPromise: () => Promise<AthenaExecutionResult<T>>; | ||
toStream: () => AthenaStream<T>; | ||
} | ||
export interface AthenaClientConfig extends AthenaRequestConfig, AthenaStreamConfig { | ||
pollingInterval?: number; | ||
queryTimeout?: number; | ||
concurrentExecMax?: number; | ||
execRightCheckInterval?: number; | ||
} | ||
export declare class AthenaClient { | ||
private config; | ||
private concurrentExecNum; | ||
private request; | ||
constructor(request: AthenaRequest, config: AthenaClientConfig); | ||
execute<T>(query: string): AthenaExecutionSelect<T>; | ||
execute<T>(query: string, callback: (err?: Error, result?: AthenaExecutionResult<T>) => void): void; | ||
private _execute<T>(query, athenaStream, config); | ||
private canStartQuery(); | ||
private startQuery(); | ||
private endQuery(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference types="node" /> | ||
import { Readable } from 'stream'; | ||
export interface AthenaRequestConfig { | ||
bucketUri: string; | ||
baseRetryWait?: number; | ||
retryWaitMax?: number; | ||
retryCountMax?: number; | ||
} | ||
export declare class AthenaRequest { | ||
private athena; | ||
private s3; | ||
constructor(athena: any, s3: any); | ||
startQuery(query: string, config: AthenaRequestConfig): Promise<string>; | ||
checkQuery(queryId: string, config: AthenaRequestConfig): Promise<boolean>; | ||
stopQuery(queryId: string, config: AthenaRequestConfig): Promise<void>; | ||
getQueryExecution(queryId: string, config: AthenaRequestConfig): Promise<any>; | ||
getResultsStream(s3Uri: string): Readable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/// <reference types="node" /> | ||
import { Duplex } from 'stream'; | ||
export interface AthenaStreamConfig { | ||
maxBufferSize?: string; | ||
} | ||
export declare class AthenaStream<T> extends Duplex { | ||
private buffer; | ||
private bufferSize; | ||
private maxBufferSize; | ||
private columns; | ||
private isEnd; | ||
constructor(config: AthenaStreamConfig); | ||
_write(buffer: Buffer, _: string, callback: (err?: Error) => void): Promise<void>; | ||
_read(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function sleep(ms: number): Promise<void>; | ||
export declare function getBytes(text: string): number; |
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.