Most of the Cirro functions available through Cirro Analyst for Excel (and described in the Cirro Functions Guide) are also available through Cirro SQL.

By accessing these functions, users can query Hadoop data and perform data manipulations with the same functionality available through Cirro Analyst for Excel.

Syntax

To call Cirro functions from SQL, compose a SELECT statement in this format:


SELECT alias.* FROM CirroFunctions.Cirro.functionName(inputSource, arguments) alias;

Arguments

  • alias: An alias for the results of the query.

  • functionName: The Cirro function name. For example, “Cirro_Twitter_Parse”.

  • inputSource: The Hadoop source, another Cirro function query, or a SELECT statement to a relational database.

  • arguments: A comma-separated list of arguments for the function. See the Cirro Functions Guide for information on the

Additional Information

  • The Cirro_To_Pivot and Cirro_To_Sheet functions cannot be used from SQL.

Examples

The following are properly-formed Cirro function calls from SQL:


-- This example shows a simple Cirro_Twitter_Parse function call.
SELECT A.* FROM CirroFunctions.Cirro.Cirro_Twitter_Parse(
'hdfs://HADOOP/usr/sampletweet','user__id,user__followers_count'
) A;


-- This example shows another Cirro function as the inputSource.
SELECT A.* FROM CirroFunctions.Cirro.Cirro_To_Lower(
CirroFunctions.Cirro.Cirro_Twitter_parse(
'hdfs://HADOOP/usr/sampletweet','user__id,user__followers_count,tet'
),' text'
) A;

 


-- This example shows a relational database table as the source for the Cirro function.
SELECT A.* FROM CirroFunctions.Cirro.Cirro_To_Lower(
(
SELECT word FROM MYSQL.orders2012.s1.word) b,'text'
) A;