You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2021/03/02 11:54:33 UTC
[GitHub] [kylin] zzcclp commented on a change in pull request #1594: KYLIN-4919 Use NonShardingReadRDD/ShardingReadRdd automatically for different queries
zzcclp commented on a change in pull request #1594:
URL: https://github.com/apache/kylin/pull/1594#discussion_r585496298
##########
File path: kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala
##########
@@ -170,7 +172,8 @@ class FilePruner(cubeInstance: CubeInstance,
}
private def genShardSpec(selected: Seq[SegmentDirectory]): Option[ShardSpec] = {
- if (!KylinConfig.getInstanceFromEnv.isShardingJoinOptEnabled || selected.isEmpty) {
+ val isJoinQuery = OLAPContext.getThreadLocalContexts.map(_.allOlapJoins).exists(_.nonEmpty);
Review comment:
This way is wrong, for example:
```
select XXX from fact_table left join join_table on ...
```
In this case shown above, the value of 'isJoinQuery' is true, but the join operator will be removed.
##########
File path: kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala
##########
@@ -170,7 +172,8 @@ class FilePruner(cubeInstance: CubeInstance,
}
private def genShardSpec(selected: Seq[SegmentDirectory]): Option[ShardSpec] = {
- if (!KylinConfig.getInstanceFromEnv.isShardingJoinOptEnabled || selected.isEmpty) {
+ val isJoinQuery = OLAPContext.getThreadLocalContexts.map(_.allOlapJoins).exists(_.nonEmpty);
Review comment:
shard join optimization is for joining two or more cubes, but not fact-table joining join-table.
----------------------------------------------------------------
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