Closed
Description
Object Builders for maps use an InternalMap
which is a sub-class of a hash map:
Hash maps are unordered, the order is defined by the internal hashing function and can be different for different runtime environments. Although the JSON standard does not define dictionaries to be ordered, it would be good to switch to a linked hash map with insertion order:
- for a user the order might have a meaning and it is easier for them if the order is preserved the way the user specified it, e.g. the output might be a ML job or transform configuration
- in some cases order can be important at runtime: [Transform] HLRC builder ignores group_by order elasticsearch#82350
Because this does not seems performance-critical, I suggest to switch to a linked hash map with insertion order