ES|QL columns with additional meta-data for type, units, meaning #108819
Labels
:Analytics/ES|QL
AKA ESQL
>enhancement
Team:Analytics
Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
In ES|QL there are many functions that extract parts of known data-types into primitive types, where the original type is still meaningful, and should be persisted.
For example, calculating a date_diff in some specified units should maintain the knowledge that the resulting
Integer
is actually a temporal type with known units:Currently this query returns a column called
m
with typeinteger
, and clients have no idea that the integer represents something like minutes, and so cannot, for example, render120699
as"83 days, 19 hours and 39 minutes"
or whatever rendering the client or app desires.To solve this, the column header in the returned JSON should be updated with an additional meta field, for example:
Further uses of meta-data in columns
This concept can be expanded to many related use-cases:
H3 geohex grid id
can be along
or akeyword
, but client would like to know that they areH3
cell-ids.ST_X
andST_Y
extract coordinates asdouble
values, but the fact that they arex
andy
orlongitude
andlatitude
is still usefulgeometry
column of one projection is seen as different from ageometry
column of another projection. This could become important if we start supporting multiple projections in future.An example showing some of this:
The text was updated successfully, but these errors were encountered: