Lookup Functions
These functions help to look up data beyond the application flow.
lookupHBase
It is used to fetch the records from Hbase table based on the following input parameters.
Input parameters: String tableName,String rowID, String columnFamily, int resultRow, String resultColumnName.
tableName (required): Hbase Table name with name space as string type.
rowID (required): String representation of unique key for record.
columnFamily (required): Column family name is in string format.
resultRow (required): Result row number.
resultColumnName (required): Result column name.
Configuration Parameters: Below are the configuration parameters of lookupHBase function.
ConnectionName (required): Hbase cluster connection name.
RowidCaching (required): Caching will be applied on the basis of row id.
Output Type | Column |
---|---|
Returns | Returns the value for the given table, rowId, columnFamily, result row number, result column name. |
Throws | Application Exception |
Use Case:
Example:
lookupHBase("tableName","rowID","columnFamily",1,"age")
will return value of age from row 1 of result for given rowId and columnFamily.
lookupRDBMS
It is used to fetch the record from RDBMS table. The application supports database lookup for Postgres, MySQL and Oracle.
Input Parameters: String sqlQuery, int resultRow, String resultColumnName
sqlQuery(required) – string type, select sql query specific to database.
resultRow (required): Result row number.
resultColumnName (required): Result column name.
Configuration Parameters:
ConnectionName(required)– Complete jdbc URL specific to database.
FunctionReturnType (required)– Return type of the function based on the result column being queried.
Output Type | Column |
---|---|
Returns | Returns the value for the given query, row number and column name. |
Throws | Application Exception |
Use Case:
Example:
lookupRDBMS(“select \* from tableName",1,"age")
will return value of age for row 1 of query result.
lookupES
Returns the result with respect to query from ElasticSearch index, outputs the given column for given row.
Input Parameters: String stringQuery, int resultRow, String resultColumnName
stringQuery(required) – string Elastic search query.
resultRow (required): Result row number
resultColumnName (required): Result column name.
Configuration Parameters:
ConnectionName(required)– Elastic search connection name.
indexName(required)- Elastic search index name.
indexType(required)- Elastic search index type.
functionReturnType (required)– Return type of the function based on the result column being queried.
Output Type | Column |
---|---|
Returns | Return the result of Elastic search query with respect to row number and column name. |
Throws | Application Exception |
Use Case:
Example:
lookupES("{\'query\':{\'match\_all\':{}}}",1,"age")
will return row 1 and column named age from search result of ES index.
lookupWS
This method is used to get the response of web service. Gathr supports REST based web service.
Input Parameters: There is no input parameter.
Configuration Parameters:
endpoint(required): The end point of URL.
methodType(required): Web service method like GET, POST, etc.
Content-type(required): The content type like application/JSON, etc.
wsparams(required): The web service parameters.
Output Type | Column |
---|---|
Returns | Return the response of web service |
Throws | Application Exception |
Use Case:
lookupSOLR
Returns the result, with respect to query, from Solr Index.
Input Parameters: String queryString, int resultRow, String resultColumnName
queryString (required): Solr search query.
resultRow (required): Result row number.
resultColumnName (required): Result column name.
Configuration Parameters:
connectionName(required)- Solr connection name.
indexName(required)- Solr index name.
Output Type | Column |
---|---|
Returns | Return the result of solr search query with respect to index name, row number and column name. |
Throws | Application Exception |
Use Case:
Example:
lookupSOLR(''\*:\*'',1,”age”)
will return you search result from Solr index for row 1 and column age of query result.
lookupHDFSPATH
Returns the boolean result, with respect to path exits or not, from HDFS.
Input Parameters:
- hdfsPath (required) – Path on HDFS.
Configuration Parameters:
ConnectionName(required)– HDFS Connection name.
FunctionReturnType (required)– Return type of the function based on the result column being queried.
Output Type | Boolean Column |
---|---|
Returns | Returns Boolean as result from HDFS. |
Throws | Application Exception |
Use Case:
Example:
lookupHDFSPATH(''hdfsPath'')
will return whether the path exists or not on HDFS.
lookupHBase64
Returns the Base64 encoded result, with respect to row and column-family passed as argument to the function, from HBase table, outputs the given column for given row.
Input parameters: String tableName,String rowID, String columnFamily, int resultRow, String resultColumnName
tableName (required): Hbase Table name with name space as string type.
rowID (required): String representation of unique key for record.
columnFamily (required): Column family name is in string format.
resultRow (required): Result row number.
resultColumnName (required): Result column name.
Configuration Parameters: Below are the configuration parameters of lookupHBase function.
ConnectionName(required)– Hbase Connection name.
RowIdCaching (required)– Caching will be applied on the basis of row id.
Output Type | Column |
---|---|
Returns | Returns the value for the given table, rowId, columnFamily result row number, result column name. |
Throws | Application Exception |
Use Case:
Example:
lookupHBase64("tableName","rowID","columnFamily",1,"age")
will return value of age from row 1 of result for given rowId and columnFamily.
If you have any feedback on Gathr documentation, please email us!