yanceysong opened a new issue, #41235: URL: https://github.com/apache/doris/issues/41235
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version 5.7 ### What's Wrong? When spring data jpa uses native SQL, a parameterized build in group by returns only the first row. ### What You Expected? // @Query(value = """ // SELECT :groupByField as fieldName, COUNT(:groupByField) as count // from user_task_query_item_view // where assignee_id = :assigneeId // group by :groupByField // """,nativeQuery = true) List<Object[]> findByAssigneeIdAndGroup(@Param("assigneeId") Long assigneeId, @Param("groupByField") String groupByField); This is the SQL I use, and there is no problem with using entitymanager in group by without building, and its return value is only 1 row ### How to Reproduce? // @Query(value = """ // SELECT :groupByField as fieldName, COUNT(:groupByField) as count // from user_task_query_item_view // where assignee_id = :assigneeId // group by :groupByField // """,nativeQuery = true) List<Object[]> findByAssigneeIdAndGroup(@Param("assigneeId") Long assigneeId, @Param("groupByField") String groupByField); This is the SQL I use, and there is no problem with using entitymanager in group by without building, and its return value is only 1 row ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
