carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1856: [CARBONDATA-2073][CARBONDATA-1516][Tests] Add...
Date Tue, 30 Jan 2018 07:37:08 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1856#discussion_r164660048
  
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/timeseries/TestTimeSeriesMatchStrategySuite.scala
---
    @@ -0,0 +1,294 @@
    +/*
    + * 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.carbondata.integration.spark.testsuite.timeseries
    +
    +import java.sql.Timestamp
    +
    +import org.apache.spark.sql.{CarbonDatasourceHadoopRelation, Row}
    +import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
    +import org.apache.spark.sql.execution.datasources.LogicalRelation
    +import org.apache.spark.sql.hive.CarbonRelation
    +import org.apache.spark.sql.test.util.QueryTest
    +import org.apache.spark.util.SparkUtil4Test
    +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
    +
    +import org.apache.carbondata.core.constants.CarbonCommonConstants
    +import org.apache.carbondata.core.util.CarbonProperties
    +
    +class TestTimeSeriesMatchStrategySuite extends QueryTest with BeforeAndAfterAll with
BeforeAndAfterEach {
    +
    +  override def beforeAll: Unit = {
    +    SparkUtil4Test.createTaskMockUp(sqlContext)
    +    CarbonProperties.getInstance()
    +      .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT,
    +        CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT)
    +
    +  }
    +
    +  override protected def beforeEach(): Unit = {
    +    sql("drop table if exists mainTable")
    +    sql(
    +      """
    +        | CREATE TABLE mainTable(
    +        |     mytime timestamp,
    +        |     name string,
    +        |     age int)
    +        | STORED BY 'org.apache.carbondata.format'
    +      """.stripMargin)
    +    sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/timeseriestest.csv' into table mainTable")
    +  }
    +
    +  val timeSeries = "preaggregate"
    +
    +  test("test timeseries match 1: select small size when there are >1 timeseries match")
{
    +
    +    dropDataMaps("maintable", "agg1_minute", "agg2_minute")
    +    sql(
    +      s"""
    +         | create datamap agg1 on table mainTable
    --- End diff --
    
    change datamap name to big_agg


---

Mime
View raw message