You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2018/12/17 14:16:46 UTC
[04/21] carbondata git commit: [CARBONDATA-3141] Removed Carbon Table
Detail Command Test case
[CARBONDATA-3141] Removed Carbon Table Detail Command Test case
Removed Carbon Table Detail Command Test case, as this is not used.
This closes #2968
Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/216d1c5b
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/216d1c5b
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/216d1c5b
Branch: refs/heads/branch-1.5
Commit: 216d1c5b267167b07aedbfb2ed94a7ad54584592
Parents: 523515c
Author: praveenmeenakshi56 <pr...@gmail.com>
Authored: Fri Nov 30 18:05:08 2018 +0530
Committer: Raghunandan S <ca...@gmail.com>
Committed: Mon Dec 17 18:56:14 2018 +0530
----------------------------------------------------------------------
.../schema/CarbonGetTableDetailCommand.scala | 61 --------------------
.../CarbonGetTableDetailComandTestCase.scala | 56 ------------------
2 files changed, 117 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/carbondata/blob/216d1c5b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonGetTableDetailCommand.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonGetTableDetailCommand.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonGetTableDetailCommand.scala
deleted file mode 100644
index 90da68a..0000000
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonGetTableDetailCommand.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.command.schema
-
-import org.apache.spark.sql.{CarbonEnv, Row, SparkSession}
-import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference}
-import org.apache.spark.sql.execution.command.DataCommand
-import org.apache.spark.sql.types.{LongType, StringType}
-
-import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier
-import org.apache.carbondata.core.statusmanager.SegmentStatusManager
-import org.apache.carbondata.core.util.CarbonProperties
-
-/**
- * collect dynamic detail information of the table, including table size, last modified time, etc.
- */
-case class CarbonGetTableDetailCommand(
- databaseName: String,
- tableNames: Option[Seq[String]])
- extends DataCommand {
-
- override def processData(sparkSession: SparkSession): Seq[Row] = {
- if (tableNames.isDefined) {
- tableNames.get.map { tablename =>
- val carbonTable = CarbonEnv.getCarbonTable(Option(databaseName),
- tablename)(sparkSession)
-
- Row(
- tablename,
- carbonTable.size,
- SegmentStatusManager
- .getTableStatusLastModifiedTime(carbonTable.getAbsoluteTableIdentifier))
- }
- } else {
- Seq.empty[Row]
- }
- }
-
- override def output: Seq[Attribute] = {
- Seq(AttributeReference("table name", StringType, nullable = false)(),
- AttributeReference("table size", LongType, nullable = false)(),
- AttributeReference("last modified time", LongType, nullable = false)())
- }
-
- override protected def opName: String = "GET TABLE DETAIL"
-}
http://git-wip-us.apache.org/repos/asf/carbondata/blob/216d1c5b/integration/spark2/src/test/scala/org/apache/spark/sql/CarbonGetTableDetailComandTestCase.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/test/scala/org/apache/spark/sql/CarbonGetTableDetailComandTestCase.scala b/integration/spark2/src/test/scala/org/apache/spark/sql/CarbonGetTableDetailComandTestCase.scala
deleted file mode 100644
index 908bc75..0000000
--- a/integration/spark2/src/test/scala/org/apache/spark/sql/CarbonGetTableDetailComandTestCase.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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
-
-import org.apache.spark.sql.execution.QueryExecution
-import org.apache.spark.sql.execution.command.schema.CarbonGetTableDetailCommand
-import org.apache.spark.sql.test.util.QueryTest
-import org.scalatest.BeforeAndAfterAll
-
-class CarbonGetTableDetailCommandTestCase extends QueryTest with BeforeAndAfterAll {
- override def beforeAll(): Unit = {
- sql("drop table if exists table_info1")
- sql("create table table_info1 (empno int, workgroupcategory string, deptno int, projectcode int, attendance int) stored by 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')")
- sql(s"""load data local inpath '$resourcesPath/data.csv' into table table_info1 options('delimiter'=',', 'quotechar'='\"', 'fileheader'='')""")
-
- sql("drop table if exists table_info2")
- sql("create table table_info2 (empno int, workgroupcategory string, deptno int, projectcode int, attendance int) stored by 'org.apache.carbondata.format' tblproperties('local_dictionary_enable'='false')")
- sql(s"""load data local inpath '$resourcesPath/data.csv' into table table_info2 options('delimiter'=',', 'quotechar'='\"', 'fileheader'='')""")
- }
-
- ignore("collect the information of tables") {
- val logicalPlan = CarbonGetTableDetailCommand("default", Some(Seq("table_info1", "table_info2")))
- val result =new QueryExecution(sqlContext.sparkSession, logicalPlan)
- .executedPlan
- .execute
- .collect
-
- assertResult(2)(result.length)
- assertResult("table_info1")(result(0).getString(0))
- // 2282 is the size of carbon table. Note that since 1.5.0, we add additional compressor name in metadata
- // and more metadata like written_by and version details are added
- assertResult(2267)(result(0).getLong(1))
- assertResult("table_info2")(result(1).getString(0))
- assertResult(2267)(result(1).getLong(1))
- }
-
- override def afterAll: Unit = {
- sql("drop table if exists table_info1")
- sql("drop table if exists table_info2")
- }
-}