Patent ID: 8639717

Claim:
A computer implemented method, comprising: receiving a first query, which references a first user-defined table function (UDTF); responsive to the received first query, by operation of a computer processor, calling the referenced first UDTF; calling a second UDTF referenced by the first UDTF, wherein the first UDTF is defined using structured query language (SQL) and wherein the second UDTF is defined using Java; submitting a second query to query a metadata table to gather attributes of the second UDTF used to construct a third query, wherein the third query accesses a database table, and wherein the gathered attributes specify an order of table columns for returning a result of the third query to the second UDTF; submitting the third query to query a table based on the attributes of the second UDTF; receiving, by the second UDTF, query results that correspond to the third query, wherein the query results are formatted according to the order of table columns specified by the gathered attributes; and providing the query results that correspond to the third query to the first UDTF.