question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

flatten transformation should create index field

See original GitHub issue

From the flatten example:

Input data:

[
  {"name": "alpha", "data": 123, "foo": [1, 2]},
  {"name": "beta",  "data": 456, "foo": [3, 4, 5]}
]

Result:

[
  {"name": "alpha", "data": 123, "foo": 1},
  {"name": "alpha", "data": 123, "foo": 2},
  {"name": "beta",  "data": 456, "foo": 3},
  {"name": "beta",  "data": 456, "foo": 4},
  {"name": "beta",  "data": 456, "foo": 5}
]

It would be infinitely more helpful if the result were:

[
  {"name": "alpha", "data": 123, "foo": 1, "index": 0},
  {"name": "alpha", "data": 123, "foo": 2, "index": 1},
  {"name": "beta",  "data": 456, "foo": 3, "index": 0},
  {"name": "beta",  "data": 456, "foo": 4, "index": 1},
  {"name": "beta",  "data": 456, "foo": 5, "index": 2}
]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jheercommented, Nov 4, 2019

Added in 0cc590a.

0reactions
domoritzcommented, Oct 30, 2019

I think what you did with only string makes sense. Can you add a few tests and update the docs?

@jheer will review and merge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flattened field type | Elasticsearch Guide [8.5] | Elastic
This data type can be useful for indexing objects with a large or unknown number of unique keys. Only one field mapping is...
Read more >
Flattening array column and creating Index ... - Stack Overflow
You can use flatten transformation to flatten the array values and Window transformation to get the RowNumber, partition by Col1.
Read more >
Flatten Transform - Trifacta Documentation
Unpacks array data into separate rows for each value. This transform operates on a single column.
Read more >
Flatten - Confluent Documentation
Flatten a nested data structure, generating names for each field by concatenating the field names at each level with a configurable delimiter character....
Read more >
Flattening Fields - Informatica Documentation
Flatten fields of a complex data type to modify hierarchical data or to convert to relational data.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found