RupengWang edited a comment on pull request #1226:
URL: https://github.com/apache/kylin/pull/1226#issuecomment-643605367


   ## Design test cases
   
   ### Prepare test env
   #### source table
   Create hive table using local csv file
   1. create local csv file
   id,name,dt
   1,wang,2019/01/01
   2,zhang,2019/01/02
   3,Lee,2019/01/03
   4,Liu,2019/01/04
   
   2. create table in hive
   ```sql
   CREATE TABLE wangrupeng.self_define_date(id int, name string, dt date) row 
format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES 
("separatorChar"=",") STORED AS TEXTFILE;
   ```
   
   3. local csv into hive table
   ```sql
   load data local inpath '/root/wangrupeng/kylin-3.1.0/test.csv' overwrite 
into table self_define_date;
   ```
   
   #### Create a new model and cube
   1. model
   ```json
   {
     "uuid": "ce9eaaeb-974d-1ae2-fb51-7333a6d7aab4",
     "last_modified": 1592045287556,
     "version": "3.0.0.20500",
     "name": "test_selfdefine_date",
     "owner": "ADMIN",
     "is_draft": false,
     "description": "",
     "fact_table": "WANGRUPENG.SELF_DEFINE_DATE",
     "lookups": [],
     "dimensions": [
       {
         "table": "SELF_DEFINE_DATE",
         "columns": [
           "ID"
         ]
       }
     ],
     "metrics": [
       "SELF_DEFINE_DATE.NAME"
     ],
     "filter_condition": "",
     "partition_desc": {
       "partition_date_column": "SELF_DEFINE_DATE.DT",
       "partition_time_column": null,
       "partition_date_start": 0,
       "partition_date_format": "yyyy/MM/dd",
       "partition_time_format": "HH:mm:ss",
       "partition_type": "APPEND",
       "partition_condition_builder": 
"org.apache.kylin.metadata.model.PartitionDesc$DefaultPartitionConditionBuilder"
     },
     "capacity": "MEDIUM",
     "projectName": "learn_kylin"
   }
   ```
   
   2. cube
   ```json
   {
     "uuid": "96fc0227-ad30-49ca-316b-b23df48dff5e",
     "last_modified": 1592045402854,
     "version": "3.0.0.20500",
     "name": "test_selfdefine_cube",
     "is_draft": false,
     "model_name": "test_selfdefine_date",
     "description": "",
     "null_string": null,
     "dimensions": [
       {
         "name": "ID",
         "table": "SELF_DEFINE_DATE",
         "column": "ID",
         "derived": null
       }
     ],
     "measures": [
       {
         "name": "_COUNT_",
         "function": {
           "expression": "COUNT",
           "parameter": {
             "type": "constant",
             "value": "1"
           },
           "returntype": "bigint"
         }
       }
     ],
     "dictionaries": [],
     "rowkey": {
       "rowkey_columns": [
         {
           "column": "SELF_DEFINE_DATE.ID",
           "encoding": "dict",
           "encoding_version": 1,
           "isShardBy": false
         }
       ]
     },
     "hbase_mapping": {
       "column_family": [
         {
           "name": "F1",
           "columns": [
             {
               "qualifier": "M",
               "measure_refs": [
                 "_COUNT_"
               ]
             }
           ]
         }
       ]
     },
     "aggregation_groups": [
       {
         "includes": [
           "SELF_DEFINE_DATE.ID"
         ],
         "select_rule": {
           "hierarchy_dims": [],
           "mandatory_dims": [],
           "joint_dims": []
         }
       }
     ],
     "signature": "ZIYGtYJLdlaTYyih6VMUyQ==",
     "notify_list": [],
     "status_need_notify": [
       "ERROR",
       "DISCARDED",
       "SUCCEED"
     ],
     "partition_date_start": 0,
     "partition_date_end": 3153600000000,
     "auto_merge_time_ranges": [],
     "volatile_range": 0,
     "retention_range": 0,
     "engine_type": 2,
     "storage_type": 2,
     "override_kylin_properties": {},
     "cuboid_black_list": [],
     "parent_forward": 3,
     "mandatory_dimension_set_list": [],
     "snapshot_table_desc_list": []
   }
   ```
   
   ### Case-1
   
   ```sql
   select count(*) from SELF_DEFINE_DATE where dt > '2019/01/02';
   ```


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


Reply via email to