This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin5-beta-release
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit f467c4bca3ea72cf3707bf9d19ad14ae47b5973c
Author: XiaoxiangYu <x...@apache.org>
AuthorDate: Fri Jul 21 14:11:24 2023 +0800

    Minor: Fix codestyle
---
 src/kylin-server-it/pom.xml                        | 16 ++++
 .../scala/io/kyligence/kap/common/SSSource.scala   | 89 ----------------------
 .../kap/common/SystemPropertyHelper.scala          | 56 --------------
 3 files changed, 16 insertions(+), 145 deletions(-)

diff --git a/src/kylin-server-it/pom.xml b/src/kylin-server-it/pom.xml
index 3f3a2dae77..fcced79d66 100644
--- a/src/kylin-server-it/pom.xml
+++ b/src/kylin-server-it/pom.xml
@@ -1,4 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0";
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
diff --git 
a/src/spark-project/spark-it/src/test/scala/io/kyligence/kap/common/SSSource.scala
 
b/src/spark-project/spark-it/src/test/scala/io/kyligence/kap/common/SSSource.scala
deleted file mode 100644
index 207700f523..0000000000
--- 
a/src/spark-project/spark-it/src/test/scala/io/kyligence/kap/common/SSSource.scala
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2016 Kyligence Inc. All rights reserved.
- * http://kyligence.io
- * This software is the confidential and proprietary information of
- * Kyligence Inc. ("Confidential Information"). You shall not disclose
- * such Confidential Information and shall use it only in accordance
- * with the terms of the license agreement you entered into with
- * Kyligence Inc.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-package io.kyligence.kap.common
-
-import java.util.Locale
-
-import org.apache.kylin.common.KylinConfig
-import org.apache.kylin.common.util.TempMetadataBuilder
-import org.apache.kylin.metadata.model.NTableMetadataManager
-import org.apache.kylin.metadata.project.NProjectManager
-import org.apache.kylin.query.util.{PushDownUtil, QueryParams}
-import org.apache.spark.sql.common.{LocalMetadata, SharedSparkSession}
-import org.apache.spark.sql.execution.utils.SchemaProcessor
-import org.scalatest.Suite
-
-import org.apache.kylin.guava30.shaded.common.base.Preconditions
-
-trait SSSource extends SharedSparkSession with LocalMetadata {
-  self: Suite =>
-
-  val CSV_TABLE_DIR: String = "../" + TempMetadataBuilder.TEMP_TEST_METADATA + 
"/data/%s.csv"
-
-  override def beforeAll(): Unit = {
-    super.beforeAll()
-    val project = getProject
-    import org.apache.kylin.metadata.project.NProjectManager
-    val kylinConf = KylinConfig.getInstanceFromEnv
-    val projectInstance =
-      NProjectManager.getInstance(kylinConf).getProject(project)
-    Preconditions.checkArgument(projectInstance != null)
-    import scala.collection.JavaConverters._
-    projectInstance.getTables.asScala
-      .filter(!_.equals("DEFAULT.STREAMING_TABLE"))
-      .foreach { table =>
-        val tableDesc = NTableMetadataManager
-          .getInstance(kylinConf, project)
-          .getTableDesc(table)
-        val columns = tableDesc.getColumns
-        val schema = SchemaProcessor.buildSchemaWithRawTable(columns)
-        var tableN = tableDesc.getName
-        if (table.equals("DEFAULT.TEST_KYLIN_FACT")) {
-          tableN = tableDesc.getName + "_table"
-        }
-        spark.catalog.createTable(
-          tableName = tableN,
-          source = "csv",
-          schema = schema,
-          options = Map("path" -> String.format(Locale.ROOT, CSV_TABLE_DIR, 
table)))
-        if (table.equals("DEFAULT.TEST_KYLIN_FACT")) {
-          spark.sql("create view " + tableDesc.getName + " as select * from " 
+ tableN)
-        }
-      }
-  }
-
-  protected def getProject: String = "default"
-
-  def cleanSql(originSql: String): String = {
-    val sqlForSpark = originSql
-      .replaceAll("edw\\.", "")
-      .replaceAll("\"EDW\"\\.", "")
-      .replaceAll("EDW\\.", "")
-      .replaceAll("default\\.", "")
-      .replaceAll("DEFAULT\\.", "")
-      .replaceAll("\"DEFAULT\"\\.", "")
-    val queryParams = new QueryParams("default", sqlForSpark, "DEFAULT", false)
-    queryParams.setKylinConfig(NProjectManager.getProjectConfig("default"))
-    PushDownUtil.massagePushDownSql(queryParams)
-  }
-}
diff --git 
a/src/spark-project/spark-it/src/test/scala/io/kyligence/kap/common/SystemPropertyHelper.scala
 
b/src/spark-project/spark-it/src/test/scala/io/kyligence/kap/common/SystemPropertyHelper.scala
deleted file mode 100644
index 40db19311a..0000000000
--- 
a/src/spark-project/spark-it/src/test/scala/io/kyligence/kap/common/SystemPropertyHelper.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2016 Kyligence Inc. All rights reserved.
- * http://kyligence.io
- * This software is the confidential and proprietary information of
- * Kyligence Inc. ("Confidential Information"). You shall not disclose
- * such Confidential Information and shall use it only in accordance
- * with the terms of the license agreement you entered into with
- * Kyligence Inc.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-package io.kyligence.kap.common
-
-
-import org.apache.kylin.guava30.shaded.common.collect.Maps
-import org.apache.kylin.common.util.Unsafe
-
-import scala.collection.JavaConverters._
-
-trait SystemPropertyHelper {
-  val propCache: java.util.HashMap[String, String] = Maps.newHashMap[String, 
String]()
-
-  def changeSystemProp(key: String, value: String): Unit = {
-    propCache.put(key, System.getProperty(key))
-    Unsafe.setProperty(key, value)
-  }
-
-  def restoreSystemProperty(): Unit = {
-    propCache.asScala.filter(_._2 != null).foreach {
-      case (key, value) =>
-        Unsafe.setProperty(key, value)
-    }
-  }
-
-  def checkSystem(key: String, desc: String = ""): Unit = {
-    if (System.getProperty(key) == null) {
-      var errorMessage = s"Could not found system property : $key. "
-      if (desc.nonEmpty) {
-        errorMessage = errorMessage + desc
-      }
-      throw new IllegalArgumentException(errorMessage)
-    }
-  }
-
-}

Reply via email to