You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/05/01 19:09:05 UTC
[GitHub] [druid] maytasm commented on pull request #9773: [WIP] Bad plan for table-lookup-lookup join with filter on first lookup and outer limit
maytasm commented on pull request #9773:
URL: https://github.com/apache/druid/pull/9773#issuecomment-622521552
> > A problem with this solution is that it does not guarantee to push the filter to the topmost DruidJoinQueryRel. This problem is showed in CalciteQueryTest#testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns where the filter is on the inner DruidJoinQueryRel instead of the other DruidJoinQueryRel.
>
> The plan in your current patch (cafca03) looks OK to me. It's exactly what we want. Do you have a different case that illustrates the issue you're talking about?
Sorry for the confusion. CalciteQueryTest#testInnerJoinTableLookupLookupWithFilterWithoutLimitWithAllColumns has @Ignore on it because it DOES NOT generate the plan in my current patch (cafca03) and hence will fail. The plan it generates is similar to the bad plan in the description of this PR.
```
2020-05-01T09:06:01,490 INFO [main] org.apache.druid.sql.calcite.util.QueryLogHook - Issued query: {
"queryType" : "scan",
"dataSource" : {
"type" : "join",
"left" : {
"type" : "query",
"query" : {
"queryType" : "scan",
"dataSource" : {
"type" : "join",
"left" : {
"type" : "table",
"name" : "foo"
},
"right" : {
"type" : "lookup",
"lookup" : "lookyloo"
},
"rightPrefix" : "j0.",
"condition" : "(\"dim2\" == \"j0.k\")",
"joinType" : "INNER"
},
"intervals" : {
"type" : "intervals",
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
},
"virtualColumns" : [ ],
"resultFormat" : "compactedList",
"batchSize" : 20480,
"limit" : 9223372036854775807,
"order" : "none",
"filter" : {
"type" : "selector",
"dimension" : "j0.v",
"value" : "xa",
"extractionFn" : null
},
"columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "j0.k", "j0.v", "m1", "m2", "unique_dim1" ],
"legacy" : false,
"context" : {
"defaultTimeout" : 300000,
"maxScatterGatherBytes" : 9223372036854775807,
"sqlCurrentTimestamp" : "2000-01-01T00:00:00Z",
"sqlQueryId" : "dummy",
"vectorize" : "false"
},
"descending" : false,
"granularity" : {
"type" : "all"
}
}
},
"right" : {
"type" : "lookup",
"lookup" : "lookyloo"
},
"rightPrefix" : "_j0.",
"condition" : "(\"dim2\" == \"_j0.k\")",
"joinType" : "INNER"
},
"intervals" : {
"type" : "intervals",
"intervals" : [ "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z" ]
},
"virtualColumns" : [ ],
"resultFormat" : "compactedList",
"batchSize" : 20480,
"limit" : 9223372036854775807,
"order" : "none",
"filter" : null,
"columns" : [ "__time", "cnt", "dim1", "dim2", "dim3", "m1", "m2", "unique_dim1" ],
"legacy" : false,
"context" : {
"defaultTimeout" : 300000,
"maxScatterGatherBytes" : 9223372036854775807,
"sqlCurrentTimestamp" : "2000-01-01T00:00:00Z",
"sqlQueryId" : "dummy",
"vectorize" : "false"
},
"descending" : false,
"granularity" : {
"type" : "all"
}
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org