Skip to content

[Bug] query result error after insert muliti-version data #12089

Closed

Description

@stalary

Search before asking

  • I had searched in the issues and found no similar issues.

Version

1.1.1

What's Wrong?

diff_count differs in each query

select count(*) as diff_count
from dws.dws_brand_consumerelec_product_sales_volume_china_d t1
         left join dws.dws_brand_consumerelec_product_sales_volume_china_v2 t2
                   on t2.first_industry = t1.first_industry and t2.third_industry = t1.third_industry and
                      t2.brand_name = t1.brand_name and
                      t2.`year_month` = t1.`year_month` and t2.platform_code = t1.platform_code
where day = '2022-08-22'
  and t2.pdsales_volume_yoy != t1.pdsales_volume_yoy;

ddl

CREATE TABLE `dws_brand_consumerelec_product_sales_volume_china_d` (
  `day` date NOT NULL COMMENT "数据写入日期",
  `first_industry` varchar(100) NOT NULL COMMENT "一级行业",
  `second_industry` varchar(100) NOT NULL COMMENT "二级行业",
  `third_industry` varchar(100) NOT NULL COMMENT "三级行业",
  `brand_name` varchar(100) NOT NULL COMMENT "品牌名",
  `year_month` int(11) NOT NULL COMMENT "年月",
  `platform_code` int(11) NOT NULL COMMENT "平台代码(1:抖音,2:天猫+京东,3:天猫+京东+抖音)",
  `pdsales_volume` decimal(27, 2) NOT NULL COMMENT "产品销量(个)",
  `pdsales_volume_yoy` decimal(27, 4) NOT NULL COMMENT "产品销量yoy",
  `update_time` datetime NOT NULL COMMENT "更新时间"
) ENGINE=OLAP
UNIQUE KEY(`day`, `first_industry`, `second_industry`, `third_industry`, `brand_name`, `year_month`, `platform_code`)
COMMENT "中国市场各品牌销量及增速按天分区表"
PARTITION BY RANGE(`day`)()
DISTRIBUTED BY HASH(`day`, `year_month`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Chongqing",
"dynamic_partition.start" = "-3650",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 3",
"dynamic_partition.buckets" = "10",
"dynamic_partition.create_history_partition" = "true",
"dynamic_partition.history_partition_num" = "100",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"in_memory" = "false",
"storage_format" = "V2"
);

CREATE TABLE `dws_brand_consumerelec_product_sales_volume_china_v2` (
  `first_industry` varchar(100) NOT NULL COMMENT "一级行业",
  `second_industry` varchar(100) NOT NULL COMMENT "二级行业",
  `third_industry` varchar(100) NOT NULL COMMENT "三级行业",
  `brand_name` varchar(100) NOT NULL COMMENT "品牌名",
  `year_month` int(11) NOT NULL COMMENT "年月",
  `platform_code` int(11) NOT NULL COMMENT "平台代码(1:抖音,2:天猫+京东,3:天猫+京东+抖音)",
  `pdsales_volume` decimal(27, 2) NOT NULL COMMENT "产品销量(个)",
  `pdsales_volume_yoy` decimal(27, 4) NOT NULL COMMENT "产品销量yoy",
  `update_time` datetime NOT NULL COMMENT "更新时间"
) ENGINE=OLAP
UNIQUE KEY(`first_industry`, `second_industry`, `third_industry`, `brand_name`, `year_month`, `platform_code`)
COMMENT "中国市场各品牌销量及增速v2"
DISTRIBUTED BY HASH(`year_month`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"in_memory" = "false",
"storage_format" = "V2"
);

What You Expected?

diff_count unique.

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. changed the title [-][Bug] query result error in decimal[/-] [+][Bug] query result error after insert muliti-version data[/+] on Aug 26, 2022
  2. stalary commented on Aug 29, 2022

    @stalary
    ContributorAuthor

    It can query normal after insert when I set enable_vectorized_engine = false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions