← Back to team overview

maria-discuss team mailing list archive

Re: R: GSOC 2015 :UDFs returning arrays

 

Hi, Justin!

On Mar 10, Justin Swanhart wrote:
> wl#820 also has table functions in it:
> http://antbits.blogspot.com/2009/01/table-functions-in-mysql.html
> 
> mysql> INSTALL PLUGIN Deep_Thought SONAME 'psm_example.so';
> mysql> CREATE FUNCTION test.FooAnswer()
>     -> RETURNS TABLE(answer TEXT)
>     -> NO SQL LANGUAGE Deep_Thought EXTERNAL NAME 'compute';
> mysql> CREATE VIEW foobar AS SELECT * FROM TABLE(test.FooAnswer) AS wibble;
> mysql> SELECT * FROM foobar WHERE answer LIKE 'F%';
> +-----------+
> | answer    |
> +-----------+
> | Forty-Two |
> +-----------+
 
Ah, indeed. Thanks.

It's still an unrelated feature - I mean, there is no reason why a table
function must necessarily be impemented as an external procedure.

And the implementation - I believe - creates a temporary table and puts
all the data into it. I would rather prefer a generator-like interface,
that produces rows one by one. It works much better for big data sets.
Or, may be, we can do both.

Either way - this implementation can be very helpful. But it'll need at
least to be updated to work in 10.1. And may be we add the generator
interface.

Regards,
Sergei



Follow ups

References