Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_array_type_columns doesn't support columns with type object #101

Open
dvanbrug opened this issue May 31, 2023 · 0 comments · May be fixed by #102
Open

get_array_type_columns doesn't support columns with type object #101

dvanbrug opened this issue May 31, 2023 · 0 comments · May be fixed by #102

Comments

@dvanbrug
Copy link

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.

for col_name, value in source.items():
# If it's a list (ES Array add to cursor)
if isinstance(value, list):
if len(value) > 0:
# If it's an array of objects add all keys
if isinstance(value[0], dict):
for in_col_name in value[0]:
array_columns.append((f"{col_name}.{in_col_name}",))
array_columns.append((f"{col_name}.{in_col_name}.keyword",))
continue
array_columns.append((col_name,))
array_columns.append((f"{col_name}.keyword",))

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant