Akshat-Jain opened a new pull request, #16971:
URL: https://github.com/apache/druid/pull/16971

   ### Description
   
   For queries like the following:
   ```sql
   select
   countryName, array_concat_agg(ARRAY[countryName], 10000) over (partition by 
countryName) as c1
   from wikipedia where countryName='Guatemala'
   group by countryName
   ```
   
   For the above query, we were getting the following in the logical plan:
   ```
   DruidWindow(window#0=[window(partition {0} aggs 
[ARRAY_CONCAT_AGG([ARRAY('Guatemala':VARCHAR)], $2)])]): rowcount = 150.0, 
cumulative cost = {301.0 rows, 38.5 cpu, 0.0 io}, id = 84
   ```
   
   But constant ARRAY isn't a literal type in Druid, it's a function. So we 
were getting an expression virtual column for this.
   ```
   [ExpressionVirtualColumn{name='v0', expression='array('Guatemala')', 
outputType=ARRAY<STRING>}]
   ```
   
   This PR changes this behavior to not return ARRAY of a literal as a constant.
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [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.
   - [ ] added integration tests.
   - [ ] 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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to