You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by techbysample <tu...@netmille.com> on 2017/09/10 23:47:27 UTC

Apache Zeppelin: What is proper syntax for calling custom SQL functons?

Forum,

I have implemented a custom SQL Function.  However, It does NOT work in
Apache Zeppelin.
Here is screenshot of the error.

Is this the proper syntax when calling a SQL function in Apache Zeppelin?

<http://apache-ignite-users.70518.x6.nabble.com/file/t4/Zeppelin.png> 

NOTE: I have successfully executed other queries in Zeppelin against the
same cache.


When I attempt the same function call (ie: GETDATA() ) from within the
Ignite Web Console (https://console.gridgain.com/), function executes
successfully.


<http://apache-ignite-users.70518.x6.nabble.com/file/t4/Gridgain_Console.png> 

   :

Please advise. The following is a code snippet of details of function
getData():
I do not believe anything is wrong with my function as it works correctly in 
Ignite Web Console:

Code Snippet:

  :
  @QuerySqlFunction
    public static SimpleResultSet getData() {
   	 SimpleResultSet rs2 = new SimpleResultSet();
   	   
     int columnCount = 3;
   	  
     rs2.addColumn("LastName", Types.VARCHAR, 0, 0);
     rs2.addColumn("FirstName", Types.VARCHAR, 0, 0);
     rs2.addColumn("SocialSecurity", Types.VARCHAR, 0, 0);

     Object[] row = new Object[columnCount];
     row[0]= "Campbell";
     row[1]= "Turik";
     row[2]= "44444444444";
     
     rs2.addRow(row);
     
     return rs2;



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Apache Zeppelin: What is proper syntax for calling custom SQL functons?

Posted by techbysample <tu...@netmille.com>.
Mike,

Thank you for your response..  As I mentioned in previous post, I have had
success with
implementing a custom SQL function to returning a resultset.

Here is the statement I used within Apache Ignite Console.

CALL "populationCache".GETDATA(); 


The following screenshot demonstrates success with Apache Ignite Console

http://apache-ignite-users.70518.x6.nabble.com/file/t4/Gridgain_Console.png

However, The issue is that that the above syntax does not work when using
Apache Zeppelin.

I thought the syntax in might be slightly different in Apache Zeppelin.

The following screenshot depicts error in Apache Zeppelin:

http://apache-ignite-users.70518.x6.nabble.com/file/t4/Zeppelin.png>

Please advise.







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Apache Zeppelin: What is proper syntax for calling custom SQL functons?

Posted by Mikhail <mi...@gmail.com>.
Hi, 

Please see the example in doc:

https://apacheignite.readme.io/docs/miscellaneous-features#section-custom-sql-functions

you can only apply custom functions to fields, that is it. 
You can just call arbitrary code with CALL statement.

Thanks,
Mike.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/