Accesses Amazon’s Athena service to run queries on S3 datasets.
How does it work?
The AmazonAthenaConnector uses your Amazon AWS account credentials to access the Athena service, either via a previously defined FME web connection, or by setting up a new FME web connection in the transformer.
AWS charges for the following:
- The amount of data scanned. All data is scanned for every query, unless the underlying data supports columnar storage.
- The storage of the source data in S3.
- The storage of the results of each query in S3, which is not cleaned up by FME.
More information on pricing: https://aws.amazon.com/athena/pricing/
The Amazon Athena reader will not typically be an efficient way to retrieve entire datasets from S3 as it is intended for retrieving subsets of datasets.
This transformer accepts any feature.
The output port will contain attributes set in the Exposed Attributes parameter, which correspond to the columns from the ran query.
The incoming feature is output through this port.
Features that cause the operation to fail are output through this port. An fme_rejection_code attribute, having the value ERROR_DURING_PROCESSING, will be added, along with a more descriptive fme_rejection_message attribute which contains more specific details as to the reason for the failure.
Note: If a feature comes in to the AmazonAthenaConnector already having a value for fme_rejection_code, this value will be removed.
Rejected Feature Handling: can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a default FME option and as a workspace parameter.
Credentials can be used from different sources. Using a web connection integrates best with FME, but in some cases, you may wish to use one of the other sources.
Available when the credential source is Web Connection. To create an Amazon Web Services connection, click the 'Account' drop-down box and select 'Add Web Connection...'.
The connection can then be managed via Tools -> FME Options... -> Web Connections.
|Region||The AWS Region in which the S3 dataset resides. Overrides the region set in the web connection if specified.|
|Embedded Credentials||Available when the credential source is Embedded. An access id and secret key can be specified directly in the transformer instead of in a web connection.|
|Use Named Query||If Yes, use a named query, otherwise specify a query.|
|Named Query||A named query to run.|
|Query||The SQL query to run.|
|Query Timeout||Seconds until a running query is cancelled. The default and maximum is 30 minutes (1800 seconds).|
The bucket and path to save the results of the query. Athena generates a metadata file and a CSV file of the results.
This should not be the same location that the Athena table source data lives or the results of subsequent queries will be contaminated by the staging files.
Note: This output is not deleted when the query completes. You should either use a location with default Object Expiration, or manually delete the output.
If checked, the query will be saved for use later.
|Database||The database the saved query.|
|Title||The title of the saved query.|
|Description||The descriptive text of the saved query.|
If checked, save the results to a table.
|Database||The database to save the table.|
|Table Name||The name of the table.|
|Description||The description of the table.|
|Output Bucket||The bucket to store the table data.|
|Output Path||The path to store the table data. This location must be empty.|
|Format||The format to store the table data. Parquet and ORC are recommended.|
The list of attributes to output. These should be the column names of the query.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Set values depending on one or more test conditions that either pass or fail.
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
|These functions manipulate and format strings.|
|A set of control characters is available in the Text Editor.|
|Math functions are available in both editors.|
|Date/Time Functions||Date and time functions are available in the Text Editor.|
|These operators are available in the Arithmetic Editor.|
|These return primarily feature-specific values.|
|FME and workspace-specific parameters may be used.|
|Creating and Modifying User Parameters||Create your own editable parameters.|
Dialog Options - Tables
Transformers with table-style parameters have additional tools for populating and manipulating values.
Enabled once you have clicked on a row item. Choices include:
Cut, Copy, and Paste
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers.
|Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output.|
|Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers.|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers.
Note: Not all tools are available in all transformers.
|Dependencies||Amazon Web Services account|
|FME Licensing Level||FME Base Edition and above|
|History||Released FME 2019.2|
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for all results about the AmazonAthenaConnector on the FME Community.
Examples may contain information licensed under the Open Government Licence – Vancouver and/or the Open Government Licence – Canada.