Adding an Amazon Athena Data Source
Currently, the Reveal SDK is in the process of decoupling the data sources from the Reveal SDK core package. In order to ensure the project's continued functionality, you might be required to install additional packages into your project. Please see the Supported Data Sources topic for more information.
Step 1 - Add an event handler for the RevealView.onDataSourcesRequested
event.
var revealView = new $.ig.RevealView("#revealView");
revealView.onDataSourcesRequested = (callback) => {
//add code here
callback(new $.ig.RevealDataSources([], [], false));
};
Step 2 - In the RevealView.onDataSourcesRequested
event handler, create a new instance of the RVAthenaDataSource object. Set the Title
and Subtitle
properties. After you have created the RVAthenaDataSource
object, add it to the data sources collection.
revealView.onDataSourcesRequested = (callback) => {
var athenaDS = new $.ig.RVAthenaDataSource();
athenaDS.title = "My Athena Data Source";
athenaDS.subtitle = "Amazon Athena";
callback(new $.ig.RevealDataSources([athenaDS], [], false));
};
When the application runs, create a new Visualization and you will see the newly created Amazon Athena data source listed in the "Select a Data Source" dialog.
Step 3 - Create a new Amazon Athena Data Source Item by creating a new instance of the RVAthenaDataSourceItem object. Specify the values for the Id
, Title
and Subtitle
properties. After you have created the RVAthenaDataSourceItem
object, add it to the data source items collection.
revealView.onDataSourcesRequested = (callback) => {
var athenaDS = new $.ig.RVAthenaDataSource();
athenaDS.title = "My Athena Data Source";
athenaDS.subtitle = "Amazon Athena";
var athenaDSI = new $.ig.RVAthenaDataSourceItem(athenaDS);
athenaDSI.id = "dataSourceItemId";
athenaDSI.title = "My Athena Data Source Item";
athenaDSI.subtitle = "Amazon Athena";
callback(new $.ig.RevealDataSources([athenaDS], [athenaDSI], false));
};
When the application runs, create a new Visualization and you will see the newly created Amazon Athena data source item listed in the "Select a Data Source" dialog.
Amazon Athena authenticates uses the RVAmazonWebServicesCredentials
. See the Authentication topic for more information.
The source code to this sample can be found on GitHub