trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.3k stars 2.97k forks source link

Table Functions support for Trino #11937

Closed kasiafi closed 2 years ago

kasiafi commented 2 years ago

This issue serves the following purposes:

  1. Decompose, prioritise and schedule the work.
  2. Provide visibility into state of the task.
  3. Provide a place for discussion and questions.

related issue: https://github.com/trinodb/trino/issues/1839 related PR: https://github.com/trinodb/trino/pull/11336

Definitions

A Table Function is a function which returns a relation, as opposed to a scalar function which returns a single value. A Polymorphic Table Function (PTF) is a Table Function which fulfils at least one of the following conditions:

Specifically, the output type of the Polymorphic Table Function may depend on the arbitrary table passed as an argument.

Scope of the task

The scope of the task is to provide full support for Table Functions, including Polymorphic Table Functions.

Subtasks

Achieved functionality

Currently, any PTF can be supported, which can be entirely realised by a connector. The connector can "capture" the PTF invocation, and replace it with a ConnectorTableHandle, which represents the PTF result.

Following work

To provide full support for PTF, as in SQL standard, we need to:

kasiafi commented 2 years ago

Closing in favor of https://github.com/trinodb/trino/issues/1839