druid
druid copied to clipboard
Fix incorrect header names for certain export queries
There is a bug where, for export queries, the column names in the file header does not use any aliases in the query. For group by queries, especially, this causes the column names refer to the internal temporary names.
This PR adds a check by passing a list of column mappings to the final column names. This should also ensure that any AS clauses used are reflected in the headers. Tests have also been added for the same.
Upgrade compatibility
If the worker is an older version, it would not use the column mappings required. In this case, there could be some workers which would use different headers for some files.
Patch notes
- Fixes a bug where export queries did not use the output names specified, and instead exported the temporary column names for some queries such as GROUP BYThis PR has:
- [ ] been self-reviewed.
- [ ] using the concurrency checklist (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in licenses.yaml
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.