-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix VirtualColumn related issues in window expressions #15119
Fix VirtualColumn related issues in window expressions #15119
Conversation
...main/java/org/apache/druid/query/rowsandcols/semantic/DefaultColumnSelectorFactoryMaker.java
Outdated
Show resolved
Hide resolved
...ssing/src/test/java/org/apache/druid/query/rowsandcols/concrete/FrameRowsAndColumnsTest.java
Outdated
Show resolved
Hide resolved
...rc/test/java/org/apache/druid/query/rowsandcols/semantic/CombinedSemanticInterfacesTest.java
Outdated
Show resolved
Hide resolved
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java
Outdated
Show resolved
Hide resolved
throw DruidException.defensive("Column[%s] not found!", column); | ||
} | ||
retVal = racColumn.toAccessor(); | ||
retVal = racColumn == null ? null : racColumn.toAccessor(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this code has made me realize that we need to do a containsKey()
check in order to actually take advantage of the cache. I.e. if we cache that it was null
, we are going to keep asking and overwriting the cache for that column because we are checking the result of .get()
instead of .containsKey()
.
I'm leaving this comment so that we have a shared understanding, not because I'm asking it to be adjusted in this PR.
for some exotic queries like: SELECT '_'||dim1, MIN(cast(0 as double)) OVER (), MIN(cast((cnt||cnt) as bigint)) OVER () FROM foo the compilation have resulted in NPE -s mostly because VirtualColumn -s were not handled properly (cherry picked from commit b95035f)
for some exotic queries like: SELECT '_'||dim1, MIN(cast(0 as double)) OVER (), MIN(cast((cnt||cnt) as bigint)) OVER () FROM foo the compilation have resulted in NPE -s mostly because VirtualColumn -s were not handled properly (cherry picked from commit b95035f)
for some exotic queries like: SELECT '_'||dim1, MIN(cast(0 as double)) OVER (), MIN(cast((cnt||cnt) as bigint)) OVER () FROM foo the compilation have resulted in NPE -s mostly because VirtualColumn -s were not handled properly
for some exotic queries like:
the compilation have resulted in
NPE
-s mostly becauseVirtualColumn
-s were not handled properly