Union multiple query datasource

Hi All,

Is there any way to union multiple query data sources .

My requirement is something like below:

"queryType": "groupBy",
  "dataSource":
     {
       "type": "union",
       "dataSources": [
           {
               "type": "query",
                "query": {
                     "type": "groupBy",
                      ...
                 }
            },
            {
               "type": "query",
                "query": {
                     "type": "groupBy",
                      ...
                 }
            },
       ]
    },
Please suggest some solution, Thanks in advance.
-Amit

I am not sure of native JSON query.

But i think you can do union in SQL from 2 different datssources, as long as the select columns match. If the SQL works, then you can embed SQL in the native JSON.

example:

{
“query” : “select TIME_EXTRACT(__time,‘month’), count(distinct fake_id) from ds group by 1 order by 1 asc”,
“resultFormat” : “object”,
“header” : true
}

Regards, Chari.

Hi,
We have a different scenario where the select columns would not be matching in the data sources.

-Amit