hit-lacus commented on issue #944: KYLIN-4246 Fix for null value and non-exist 
value in json parser.
URL: https://github.com/apache/kylin/pull/944#issuecomment-554588899
 
 
   ### Model and Cube and SQL
   
   ```json
   {
     "uuid": "11e2bbd5-f0f5-ac36-7877-61bfe1edafcc",
     "last_modified": 1573865791073,
     "version": "3.0.0.20500",
     "name": "TestNullRT",
     "owner": "ADMIN",
     "is_draft": false,
     "description": "",
     "fact_table": "DEFAULT.TESTNULL",
     "lookups": [],
     "dimensions": [
       {
         "table": "TESTNULL",
         "columns": [
           "REQUIRED_DIMENSION_1",
           "OPTIONAL_DIMENSION_1",
           "HOUR_START",
           "MINUTE_START"
         ],
         "id": 1
       }
     ],
     "metrics": [
       "TESTNULL.MEASURE_1"
     ],
     "filter_condition": "",
     "partition_desc": {
       "partition_date_column": null,
       "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"
   }
   ```
   
   
   ```json
   {
     "uuid": "f58ad99b-b325-f2ca-6acb-c9abd8bcd595",
     "last_modified": 1573866225347,
     "version": "3.0.0.20500",
     "name": "TestNullCube",
     "is_draft": false,
     "model_name": "TestNullRT",
     "description": "",
     "null_string": null,
     "dimensions": [
       {
         "name": "REQUIRED_DIMENSION_1",
         "table": "TESTNULL",
         "column": "REQUIRED_DIMENSION_1",
         "derived": null
       },
       {
         "name": "OPTIONAL_DIMENSION_1",
         "table": "TESTNULL",
         "column": "OPTIONAL_DIMENSION_1",
         "derived": null
       },
       {
         "name": "HOUR_START",
         "table": "TESTNULL",
         "column": "HOUR_START",
         "derived": null
       },
       {
         "name": "MINUTE_START",
         "table": "TESTNULL",
         "column": "MINUTE_START",
         "derived": null
       }
     ],
     "measures": [
       {
         "name": "_COUNT_",
         "function": {
           "expression": "COUNT",
           "parameter": {
             "type": "constant",
             "value": "1"
           },
           "returntype": "bigint"
         }
       },
       {
         "name": "SUM_MEASURE_1",
         "function": {
           "expression": "SUM",
           "parameter": {
             "type": "column",
             "value": "TESTNULL.MEASURE_1"
           },
           "returntype": "bigint"
         }
       }
     ],
     "dictionaries": [],
     "rowkey": {
       "rowkey_columns": [
         {
           "column": "TESTNULL.REQUIRED_DIMENSION_1",
           "encoding": "dict",
           "encoding_version": 1,
           "isShardBy": false
         },
         {
           "column": "TESTNULL.OPTIONAL_DIMENSION_1",
           "encoding": "dict",
           "encoding_version": 1,
           "isShardBy": false
         },
         {
           "column": "TESTNULL.HOUR_START",
           "encoding": "time",
           "encoding_version": 1,
           "isShardBy": false
         },
         {
           "column": "TESTNULL.MINUTE_START",
           "encoding": "time",
           "encoding_version": 1,
           "isShardBy": false
         }
       ]
     },
     "hbase_mapping": {
       "column_family": [
         {
           "name": "F1",
           "columns": [
             {
               "qualifier": "M",
               "measure_refs": [
                 "_COUNT_",
                 "SUM_MEASURE_1"
               ]
             }
           ]
         }
       ]
     },
     "aggregation_groups": [
       {
         "includes": [
           "TESTNULL.REQUIRED_DIMENSION_1",
           "TESTNULL.OPTIONAL_DIMENSION_1",
           "TESTNULL.HOUR_START",
           "TESTNULL.MINUTE_START"
         ],
         "select_rule": {
           "hierarchy_dims": [],
           "mandatory_dims": [],
           "joint_dims": []
         }
       }
     ],
     "signature": "yxjdGQqJwieSRlxHdhDwww==",
     "notify_list": [],
     "status_need_notify": [
       "ERROR",
       "DISCARDED",
       "SUCCEED"
     ],
     "partition_date_start": 0,
     "partition_date_end": 3153600000000,
     "auto_merge_time_ranges": [
       604800000,
       2419200000
     ],
     "volatile_range": 0,
     "retention_range": 0,
     "engine_type": 2,
     "storage_type": 3,
     "override_kylin_properties": {
       "kylin.stream.cube.window": "600",
       "kylin.stream.cube.duration": "300",
       "kylin.stream.index.checkpoint.intervals": "300",
       "kylin.cube.algorithm": "INMEM",
       "kylin.stream.segment.retention.policy": "fullBuild"
     },
     "cuboid_black_list": [],
     "parent_forward": 3,
     "mandatory_dimension_set_list": [],
     "snapshot_table_desc_list": []
   }
   ```
   
   ```sql
   select count(*) as total_row from NULLTEST
   
   select REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1 ,count(*) as row_count, 
sum(measure_1) as sum_1
   from NULLTEST
   where OPTIONAL_DIMENSION_1 is not null
   group by REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1
   order by REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1
   
   
   select REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1 ,count(*) as row_count, 
sum(measure_1) as sum_1
   from NULLTEST
   where OPTIONAL_DIMENSION_1 is null
   group by REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1
   order by REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1
   
   select REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1 ,count(*) as row_count, 
sum(measure_1) as sum_1
   from NULLTEST
   group by REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1
   order by REQUIRED_DIMENSION_1, OPTIONAL_DIMENSION_1
   ```

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


With regards,
Apache Git Services

Reply via email to