h1. {color:#000000}{*}Google Spreadsheet Translator{*}{color} |
h1. Google Spreadsheet Translator |
|
{color:#333333}The {color}{color:#333333}{_}google-spreadsheet{_}{color}{color:#333333} translator The _google-spreadsheet_ translator is used to connect to a Google Spreadsheet. To use the Google Spreadsheet Translator you need to configure and deploy the Google JCA connector - see the Admin Guide.{color} |
|
{color:#333333}The query approach expects the data in the worksheet to be in a specific format. Namely:{color} |
* Any column that has data is queryable. * Any non-string column with an empty cell has the value retrieved as null, otherwise it is the empty string. * If the first row is present and contains string values, then it will be assumed to represent the column labels. |
{color:#333333}If you are using a dynamic vdb, the metadata for your Google account (worksheets and information about columns in worksheets) are loaded upon translator start up. If you make any changes in data types, it is advisable to restart your vdb.{color} |
|
{color:#333333}The translator supports queries against a single sheet. It supports ordering, aggregation, basic predicates, and most of the functions supported by the spreadsheet query language.{color} |
|
{color:#333333}There are no google-spreadsheet importer settings, but it does provide metadata for dynamic VDBs.{color} |
h3. Native Queries Google spreadsheet source procedures may be created using the teiid_rel:native-query extension - see [Parameterizable Native Queries|Translators#native]. The procedure will invoke the native-query similar to an native procedure call with the benefits that the query is predetermined and that result column types are known, rather than requiring the use of ARRAYTABLE or similar functionality. h4. *Native Procedure* {warning} This feature is turned off by default because of the security risk this exposes to execute any command against the source. To enable this feature, override the translator property called "SupportsNativeQueries" to true. Look for [Override Execution Properties|Translators#Override Execution Properties] above. {warning} Google spreadsheet translator provides a procedure with name *native* that gives ability to execute any ad-hoc native google spreadsheet queries directly against the source without any Teiid parsing or resolving. Since the metadata of this procedure's execution results are not known to the Teiid and they are returned as object array. User can use [ARRAYTABLE] to construct a build a tabular output for consumption by client applications. Teiid exposes this procedure with a simple query structure as below h5. Select {code:lang=SQL|title=Select Example} SELECT x.* FROM (call pm1.native('worksheet=People;query=SELECT A, B, C')) w, ARRAYTABLE(w.tuple COLUMNS "id" string , "type" string, "name" String) AS x {code} the first argument takes semi-colon(\;) separated name value pairs of following properties to execute the procedure ||Property||Description||Required|| |worksheet|Google spreadsheet name|yes| |query|spreadsheet query|yes| |limit|number rows to fetch|no| |offset|offset of rows to fetch from limit or beginning|no| {info:tip=Name of the Native Procedure} By default the name of the procedure that executes the queries directly is called *native*, however user can set [Override Execution Properties|Translators#Override Execution Properties] property on _NativeQueryProcedureName_ in vdb.xml file to change it to any other procedure name. {info} |
The google-spreadsheet translator is used to connect to a Google Spreadsheet. To use the Google Spreadsheet Translator you need to configure and deploy the Google JCA connector - see the Admin Guide.
The query approach expects the data in the worksheet to be in a specific format. Namely:
If you are using a dynamic vdb, the metadata for your Google account (worksheets and information about columns in worksheets) are loaded upon translator start up. If you make any changes in data types, it is advisable to restart your vdb.
The translator supports queries against a single sheet. It supports ordering, aggregation, basic predicates, and most of the functions supported by the spreadsheet query language.
There are no google-spreadsheet importer settings, but it does provide metadata for dynamic VDBs.
Google spreadsheet source procedures may be created using the teiid_rel:native-query extension - see Parameterizable Native Queries. The procedure will invoke the native-query similar to an native procedure call with the benefits that the query is predetermined and that result column types are known, rather than requiring the use of ARRAYTABLE or similar functionality.
This feature is turned off by default because of the security risk this exposes to execute any command against the source. To enable this feature, override the translator property called "SupportsNativeQueries" to true. Look for Override Execution Properties above. |
Google spreadsheet translator provides a procedure with name native that gives ability to execute any ad-hoc native google spreadsheet queries directly against the source without any Teiid parsing or resolving. Since the metadata of this procedure's execution results are not known to the Teiid and they are returned as object array. User can use ARRAYTABLE to construct a build a tabular output for consumption by client applications. Teiid exposes this procedure with a simple query structure as below
SELECT x.* FROM (call pm1.native('worksheet=People;query=SELECT A, B, C')) w, ARRAYTABLE(w.tuple COLUMNS "id" string , "type" string, "name" String) AS x
the first argument takes semi-colon(;) separated name value pairs of following properties to execute the procedure
Property | Description | Required |
---|---|---|
worksheet | Google spreadsheet name | yes |
query | spreadsheet query | yes |
limit | number rows to fetch | no |
offset | offset of rows to fetch from limit or beginning | no |
By default the name of the procedure that executes the queries directly is called native, however user can set Override Execution Properties property on NativeQueryProcedureName in vdb.xml file to change it to any other procedure name. |