elasticsearch-dbapi icon indicating copy to clipboard operation
elasticsearch-dbapi copied to clipboard

`get_array_type_columns` doesn't support columns with type `object`

Open dvanbrug opened this issue 1 year ago • 0 comments

When interacting with a table with columns that contain objects, the get_array_type_columns method below does not return all the array type columns.

https://github.com/preset-io/elasticsearch-dbapi/blob/0bce4403daf947867915eec0f00b22bb04a6db6d/es/elastic/api.py#L194-L205

For example, when using ECS, the event.category column is an array, but does not get identified by this method as it only looks at the event column and not the sub-columns.

Instead, this block should also analyze the object components and check those for being arrays as well.

Tested on ElasticSearch 8.6.1

dvanbrug avatar May 31 '23 19:05 dvanbrug