slim bouguerra created CALCITE-2236:
---------------------------------------
Summary: Avoid duplications of fields names during Druid query
planing
Key: CALCITE-2236
URL: https://issues.apache.org/jira/browse/CALCITE-2236
Project: Calcite
Issue Type: Bug
Components: druid
Affects Versions: 1.16.0
Reporter: slim bouguerra
Assignee: slim bouguerra
Fix For: 1.16.1
This issue occurs if two projects layers use the same fields name, it will lead
to a Druid query with a duplicated field names.
I can not reproduce this in Calcite but it is reproducible in
[Hive|https://issues.apache.org/jira/browse/HIVE-19044] (it has to deal on how
different layers of project are getting names)
Here is an example of faulty query where "$f4" is used twice.
{code}
{"queryType":"groupBy","dataSource":"druid_tableau.calcs","granularity":"all","dimensions":[{"type":"default","dimension":"key","outputName":"key","outputType":"STRING"}],"limitSpec":{"type":"default"},"aggregations":[{"type":"doubleSum","name":"$f1","fieldName":"num0"},{"type":"filtered","filter":{"type":"not","field":{"type":"selector","dimension":"num0","value":null}},"aggregator":{"type":"count","name":"$f2","fieldName":"num0"}},{"type":"doubleSum","name":"$f3","expression":"(\"num0\"
* \"num0\")"},{"type":"doubleSum","name":"$f4","expression":"(\"num0\" *
\"num0\")"}],"postAggregations":[{"type":"expression","name":"$f4","expression":"pow(((\"$f4\"
- ((\"$f1\" * \"$f1\") / \"$f2\")) /
\"$f2\"),0.5)"}],"intervals":["1900-01-01T00:00:00.000Z/3000-01-01T00:00:00.000Z"]}
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)