ATLAS-5148: Atlas DSL GROUP BY fails for non-String attributes (DATE/Long)#500
Open
aditya-gupta36 wants to merge 1 commit intoapache:masterfrom
Open
ATLAS-5148: Atlas DSL GROUP BY fails for non-String attributes (DATE/Long)#500aditya-gupta36 wants to merge 1 commit intoapache:masterfrom
aditya-gupta36 wants to merge 1 commit intoapache:masterfrom
Conversation
8cb8136 to
d550c22
Compare
pinal-shah
requested changes
Feb 5, 2026
...us/src/test/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphTraversalTest.java
Show resolved
Hide resolved
.../janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphTraversal.java
Show resolved
Hide resolved
d550c22 to
807dab2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Problem Description (Before Fix)
Query:
Table groupby(owner)
Conclusion: Works
Query:
Table groupby(createTime)
Conclusion: Returns no records
Both owner (String) and createTime (Date/Long) attributes exist on the same hive_table entities.
Query:
Table groupby(createTime) select owner, name, max(createTime)
Conclusion: Returns no records
Similar query using a String attribute works as expected:
Table groupby(owner) select owner, count()
Conclusion: Works
GROUP BY keys were handled only for String data types
When grouping by non-String attributes (Date/Long), valid group keys were dropped during result processing
This resulted in empty results even though grouping succeeded internally
Fix Description (After Fix)
Updated method:
AtlasJanusGraphTraversal.getAtlasVertexMap()
Logic change:
String keyStr = (key instanceof String) ? (String) key : String.valueOf(key);
This converts GROUP BY keys of type Long, Date, Integer, etc. into String. Prevents valid GROUP BY results from being dropped
Query:
Table groupby(createTime)
Conclusion: Returns grouped results
The following queries now return valid results:
Table groupby(createTime) select owner, name, min(createTime)
Table groupby(createTime) select owner, name, max(createTime)
How was this patch tested?
. UI testing
. Local Build (jdk8/17)
. PC: https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/2029/
. CI workflow