[STRMCMP-610] Fix flink config rendering #75
Merged
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.
Flink's config format looks like YAML, but is not really YAML. The parser is extremely simple, and basically operates just by splitting each line on
:
and treating the first part as a key and the second as the value.Currently we are using gopkg.in/yaml.v2 to render the config. However, this breaks in the case of long strings with spaces (like
). In that case, yaml.v2 will convert the space into a line break (go-yaml/yaml#166), producing output like
This is valid YAML, but cannot be handled by flink's simple parser.
This PR fixes the issue by doing the printing ourselves. As flink only supports simple key-value pairs in its config, this is pretty straightforward and more correct than using a real YAML library.
This is an incompatible change for apps that have a long, space-separated config