[PoC] adding basic apache arrow support to expressions #183909
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The goal of this PR is to test out how feasible it is to convert from kibana datatable to arrow table and vice versa. This will allow us to further test converting various parts of kibana to this new data format.
This adds basic support for apache arrow to expressions:
with this we can test converting from/to and allows us to:
How to test
to test this you will need to add the following to your kibana.yaml, as arrow library is using unsafe eval under the hood:
csp.script_src: ['unsafe-eval']
then go to canvas and try with theese expressions:
demoarrow rows=1000 | table
generates arrow table and converts it to datatable so it can be rendered by tabledemoarrow | arrowlog
generates arrow table and logs first row to the consoledemodata | arrowlog | table
generates datatable, converts to arrow table, logs first row, converts to datatable and renders the tabledemoarrow rows=1 | arrowlog | legacyMetricVis percentageMode=false colorMode="None" showLabels=true metric={visdimension accessor=0 format="number"}
to test with legacy metric visIssues discovered
unsafe-eval
enabled.relevant content online
https://arrow.apache.org/docs/js/
https://observablehq.com/@theneuralbit/using-apache-arrow-js-with-large-datasets
https://arrow.apache.org/docs/js/classes/Arrow_dom.Table.html
https://github.com/apache/arrow/blob/main/js/src/table.ts
outcome
whats required to actually move forward: