[ 
https://issues.apache.org/jira/browse/KYLIN-4857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263030#comment-17263030
 ] 

ASF GitHub Bot commented on KYLIN-4857:
---------------------------------------

hit-lacus commented on a change in pull request #1538:
URL: https://github.com/apache/kylin/pull/1538#discussion_r555471679



##########
File path: 
kylin-spark-project/kylin-spark-query/src/main/scala/org/apache/spark/sql/metrics/SparderMetricsListener.scala
##########
@@ -0,0 +1,137 @@
+/*
+ * 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.metrics
+
+import org.apache.kylin.metrics.QuerySparkMetrics
+import org.apache.spark.internal.Logging
+import org.apache.spark.scheduler._
+import org.apache.spark.sql.execution.SQLExecution
+import org.apache.spark.sql.execution.ui.{SparkListenerSQLExecutionEnd, 
SparkListenerSQLExecutionStart}
+
+class SparderMetricsListener() extends SparkListener with Logging {
+
+  var stageJobMap:Map[Int, Int] = Map()
+  var jobExecutionMap:Map[Int, QueryInformation] = Map()
+  var executionInformationMap:Map[Long, ExecutionInformation] = Map()
+
+  val queryExecutionMetrics = QuerySparkMetrics.getInstance()
+
+  override def onJobStart(event: SparkListenerJobStart): Unit = {
+    val executionIdString = 
event.properties.getProperty(SQLExecution.EXECUTION_ID_KEY)
+    val sparderName = event.properties.getProperty("spark.app.name")
+    val kylinQueryId = event.properties.getProperty("kylin.query.id")
+
+    if (executionIdString == null || kylinQueryId == null) {
+      // This is not a job created by SQL
+      logInfo("Cannot happened.")

Review comment:
       Remove this line.




----------------------------------------------------------------
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]


> Refactor system cube for kylin4
> -------------------------------
>
>                 Key: KYLIN-4857
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4857
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Metrics
>    Affects Versions: v4.0.0-alpha
>            Reporter: Yaqian Zhang
>            Assignee: Yaqian Zhang
>            Priority: Minor
>             Fix For: v4.0.0-beta
>
>
> With the change of query engine and storage, the query related metrics 
> collected by system cube in kylin3 are no longer applicable to kylin4, so it 
> needs to be refactor to adapt to the spark query engine in kylin4.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to