You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/24 08:36:49 UTC

[GitHub] [incubator-doris] EmmyMiao87 opened a new issue #4433: The scale and precision of column type is incorrect in mv

EmmyMiao87 opened a new issue #4433:
URL: https://github.com/apache/incubator-doris/issues/4433


   **Describe the bug**
   The scale and precision of column type is incorrect in mv. 
   For example, the base column is DECIMAL(9,3). When mv is created, the mv column is changed to DECIMAL(9,0) which is incorrect.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. create table
   
   ```
   CREATE TABLE test_sys_materialized_view_2_test_create_dup_min_mv_tb_dup ( k0 BOOLEAN NOT NULL, k1 TINYINT NOT NULL, k2 SMALLINT NOT NULL, k3 INT NOT NULL, k4 BIGINT NOT NULL, k5 LARGEINT NOT NULL, k6 DECIMAL(9,3) NOT NULL, k7 CHAR(5) NOT NULL, k8 DATE NOT NULL, k9 DATETIME NOT NULL, k10 VARCHAR(20) NOT NULL, k11 DOUBLE NOT NULL, k12 FLOAT NOT NULL ) DISTRIBUTED BY HASH(k0) BUCKETS 10
   ```
   
   2. create materialized view
   
   ```
   CREATE MATERIALIZED VIEW min_mv AS select k0, min(k1), min(k2), min(k3), min(k4), min(k5), min(k6), min(k7), min(k8), min(k9), min(k10), min(k11), min(k12) from test_sys_materialized_view_2_test_create_dup_min_mv_tb_dup group by k0
   ```
   
   3. desc table
   
   ```
   +------------------------------------------------------------+---------------+-------+--------------+------+-------+---------+-------+---------+
   | IndexName                                                  | IndexKeysType | Field | Type         | Null | Key   | Default | Extra | Visible |
   +------------------------------------------------------------+---------------+-------+--------------+------+-------+---------+-------+---------+
   | test_sys_materialized_view_2_test_create_dup_min_mv_tb_dup | DUP_KEYS      | k0    | BOOLEAN      | No   | true  | NULL    |       | true    |
   |                                                            |               | k1    | TINYINT      | No   | true  | NULL    |       | true    |
   |                                                            |               | k2    | SMALLINT     | No   | true  | NULL    |       | true    |
   |                                                            |               | k3    | INT          | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k4    | BIGINT       | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k5    | LARGEINT     | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k6    | DECIMAL(9,3) | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k7    | CHAR(5)      | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k8    | DATE         | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k9    | DATETIME     | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k10   | VARCHAR(20)  | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k11   | DOUBLE       | No   | false | NULL    | NONE  | true    |
   |                                                            |               | k12   | FLOAT        | No   | false | NULL    | NONE  | true    |
   |                                                            |               |       |              |      |       |         |       |         |
   | min_mv                                                     | AGG_KEYS      | k0    | BOOLEAN      | No   | true  | NULL    |       | true    |
   |                                                            |               | k1    | TINYINT      | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k2    | SMALLINT     | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k3    | INT          | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k4    | BIGINT       | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k5    | LARGEINT     | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k6    | DECIMAL(9,0) | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k7    | CHAR(*)      | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k8    | DATE         | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k9    | DATETIME     | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k10   | VARCHAR(*)   | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k11   | DOUBLE       | No   | false | NULL    | MIN   | true    |
   |                                                            |               | k12   | FLOAT        | No   | false | NULL    | MIN   | true    |
   +------------------------------------------------------------+---------------+-------+--------------+------+-------+---------+-------+---------+
   ```
   
   The scale and precision of  decimal, char, varchar is incorrect.
   
   **Expected behavior**
   The scale and precision of mv column should be same as base column.
   
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman closed issue #4433: The scale and precision of column type is incorrect in mv

Posted by GitBox <gi...@apache.org>.
morningman closed issue #4433:
URL: https://github.com/apache/incubator-doris/issues/4433


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org