This PR removes the need of the ColumnVector as a result of expression evaluation and instead returns an arrow.Array.
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
In the new engine, we need fully qualified column names, since columns from different sources can have the same name.
Right now, the distinction between columns with the same name is implemented using the `Metadata` field on the `arrow.Field`. However, it is quite cumbersome to parse the column type and data type from this generic map.
This PR introduces package with naming conventions for columns, defined by name, data type, and column type. So, this information can be encoded into the `Name` field of the `arrow.Field`. The convention is defined as
```
[DATA_TYPE].[COLUMN_TYPE].[COLUMN_NAME]
```
#### Examples:
* `utf8.label.service_name`
* `timestamp_ns.builtin.timestamp`
The column type can easily be converted into a `Scope`, which is defined by an origin and type.
The mapping is as follows:
```
ColumnTypeBuiltin -> Scope{Record, Attribute}
ColumnTypeMetadata -> Scope{Record, Builtin}
ColumnTypeLabel -> Scope{Resource, Attribute}
ColumnTypeParsed -> Scope{Generated, Attribute}
ColumnTypeGenerated -> Scope{Generated, Builtin}
ColumnTypeAmbiguous -> Scope{Unscoped, Attribute}
```
---
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
This moves packages around to reduce the surface area of the public engine API:
* `pkg/engine/planner` moves to `pkg/engine/internal/planner`
* `pkg/engine/executor` moves to `pkg/engine/internal/executor`
These packages were only used from `pkg/engine` and did not need to be public.
We may make them public again in the future if we want to expose subcomponents
of the engine.
This move means that `pkg/engine/planner/internal/tree` became
`pkg/engine/internal/planner/internal/tree`. To reduce the import path, I also
moved that package to `pkg/engine/internal/util/tree`.
Other than moving files and updating import paths, no code changes are made.
Signed-off-by: Robert Fratto <robertfratto@gmail.com>