Skip to content

TableFunctionImpl to enable queries from the last_cache #25095

@hiltontj

Description

@hiltontj

This depends on #25093. Once the internal last cache has been set up and implements Datafusion's TableProvider, we can create the User-Defined Table Function (UDTF) implementation using Datafusion's TableFunctionImpl trait.

The API for this function should look like so:

last_cache(table_name, [cache_name])
  • table_name: the table in the database that has the last cache
  • cache_name (optional): if there are multiple last caches for a table, the name of the last cache must be passed

So, its usage would look like so

SELECT * FROM last_cache('cpu')
SELECT time, usage FROM last_cache('cpu', 'cpu_usage_cache')

The last cache can be combined with predicates to operate on keys used in the last cache:

SELECT * FROM last_cache('mem') WHERE host = 'us-east'

Getting this to work may require some upstream changes to influxdb3_core to extend the IOxSessionContext with the UDTF.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions