To my eyes, PR #15552 introduced some code that is questionable as to thread safety of ConstantExprs: #15552 (comment). This was reverted for the 29 release branch, but is still present in master. To avoid any questionableness, we should address it somehow prior to releasing Druid 30. Some options: