clintropolis opened a new pull request, #12718:
URL: https://github.com/apache/druid/pull/12718
### Description
Fixes a bug in #12241 from a simple mistake I made that results in modifying
the Map that is being iterated over ending up in a
`ConcurrentModificationException`. The added test fails to plan due to this
error prior to the changes in this PR, with one of these in the stack trace:
```
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469)
at java.util.HashMap$EntryIterator.next(HashMap.java:1503)
at java.util.HashMap$EntryIterator.next(HashMap.java:1501)
at
org.apache.druid.sql.calcite.rel.VirtualColumnRegistry.visitAllSubExpressions(VirtualColumnRegistry.java:212)
at
org.apache.druid.sql.calcite.rel.DruidQuery.getVirtualColumns(DruidQuery.java:643)
```
I tried to fix this by using `replaceAll`, but still saw the exception, so
ended up just copying everything to a new collection and going through them
that way.
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [x] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]