[
https://issues.apache.org/jira/browse/KYLIN-4925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17347459#comment-17347459
]
ASF GitHub Bot commented on KYLIN-4925:
---------------------------------------
zzcclp commented on a change in pull request #1601:
URL: https://github.com/apache/kylin/pull/1601#discussion_r635033446
##########
File path:
kylin-spark-project/kylin-spark-common/src/main/spark31/org/apache/spark/sql/execution/KylinFileSourceScanExec.scala
##########
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.execution
+
+import org.apache.hadoop.fs.{BlockLocation, FileStatus, LocatedFileStatus,
Path}
+import org.apache.kylin.common.KylinConfig
+import org.apache.spark.rdd.RDD
+import org.apache.spark.sql.catalyst.expressions.{Ascending, Attribute,
Expression, ExpressionUtils, SortOrder}
+import org.apache.spark.sql.catalyst.plans.physical.{HashPartitioning,
Partitioning, UnknownPartitioning}
+import org.apache.spark.sql.catalyst.{InternalRow, TableIdentifier}
+import org.apache.spark.sql.execution.datasource.{FilePruner, ShardSpec}
+import org.apache.spark.sql.execution.datasources._
+import org.apache.spark.sql.execution.metric.SQLMetrics
+import org.apache.spark.sql.types.StructType
+
+import scala.collection.mutable.ArrayBuffer
+
+class KylinFileSourceScanExec(
+ @transient override val relation: HadoopFsRelation,
+ override val output: Seq[Attribute],
+ override val requiredSchema: StructType,
+ override val partitionFilters: Seq[Expression],
+ val optionalShardSpec: Option[ShardSpec],
+ override val dataFilters: Seq[Expression],
+ override val tableIdentifier: Option[TableIdentifier]) extends
FileSourceScanExec(
+ relation, output, requiredSchema, partitionFilters, None, None, dataFilters,
tableIdentifier, false) {
+
+ private lazy val _inputRDD: RDD[InternalRow] = {
+ val readFile: (PartitionedFile) => Iterator[InternalRow] =
+ relation.fileFormat.buildReaderWithPartitionValues(
+ sparkSession = relation.sparkSession,
+ dataSchema = relation.dataSchema,
+ partitionSchema = relation.partitionSchema,
+ requiredSchema = requiredSchema,
+ filters = pushedDownFilters,
+ options = relation.options,
+ hadoopConf =
relation.sparkSession.sessionState.newHadoopConfWithOptions(relation.options))
+
+ optionalShardSpec match {
+ case Some(spec) if
KylinConfig.getInstanceFromEnv.isShardingJoinOptEnabled =>
+ createShardingReadRDD(spec, readFile, selectedPartitions, relation)
+ case _ =>
+ createNonShardingReadRDD(readFile, selectedPartitions, relation)
+ }
Review comment:
Please reference to the implementation of FileSourceScanExec.
--
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:
[email protected]
> Use Spark 3 as build and query engine for Kylin 4
> -------------------------------------------------
>
> Key: KYLIN-4925
> URL: https://issues.apache.org/jira/browse/KYLIN-4925
> Project: Kylin
> Issue Type: New Feature
> Components: Job Engine, Query Engine
> Reporter: Congling Xia
> Assignee: Congling Xia
> Priority: Major
> Fix For: v4.0.0-GA
>
>
> Spark 3 provides much more developed AQE framework, DPP and the increased
> support for GPUs and Kubernetes. The perspectives of performance increase are
> very promising.
> Currently, we try to run Kylin 4.0 with Spark 3.0 as build & query engine.
> We'd like to share the code changes here.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)