This message was deleted.
# troubleshooting
s
This message was deleted.
a
Do you mean a usecase that queries that hit two different datasources, like https://druid.apache.org/docs/latest/querying/sql.html#table-level? If not could you provide an example of a query?
k
Yeah - Query similar to the one shared in above link as well:
Copy code
{
  "queryType": "groupBy",
  "dataSource":
     {
       "type": "union",
       "dataSources": [
           {
               "type": "query",
                "query": {
                     "type": "groupBy",
                      ...
                 }
            },
            {
               "type": "query",
                "query": {
                     "type": "groupBy",
                      ...
                 }
            },
       ]
    },
  "granularity": "day",
  "dimensions": ["country", "device"],
  "limitSpec": { "type": "default", "limit": 5000, "columns": ["country", "data_transfer"] },
  "filter": {
    "type": "and",
    "fields": [
      { "type": "selector", "dimension": "carrier", "value": "AT&T" },
      { "type": "or", 
        "fields": [
          { "type": "selector", "dimension": "make", "value": "Apple" },
          { "type": "selector", "dimension": "make", "value": "Samsung" }
        ]
      }
    ]
  },
  "aggregations": [
    { "type": "longSum", "name": "total_usage", "fieldName": "user_count" },
    { "type": "doubleSum", "name": "data_transfer", "fieldName": "data_transfer" }
  ],
  "postAggregations": [
    { "type": "arithmetic",
      "name": "avg_usage",
      "fn": "/",
      "fields": [
        { "type": "fieldAccess", "fieldName": "data_transfer" },
        { "type": "fieldAccess", "fieldName": "total_usage" }
      ]
    }
  ],
  "intervals": [ "2012-01-01T00:00:00.000/2012-01-03T00:00:00.000" ],
  "having": {
    "type": "greaterThan",
    "aggregation": "total_usage",
    "value": 100
  }
}
g
currently
union
of
query
is not supported. we'll be adding it in a future release
k
Hey @Gian Merlino - Thanks. Do we’ve any timeline for this? Or any suggestion on a workaround for now?
g
No specific timeline although definitely working towards supporting full SQL is important to us. So hopefully not too long In the meantime, hard to suggest a workaround without understanding more of what you're trying to do. Perhaps a table-level union would work? ie union of two or more tables and then doing your queries on top of that
s
Is there any workaround in sql way to do table level union with non identical schema datasources ? This can be done in native queries. But this cannot be saved as
view
. I am using superset to query druid