大数据之写入Doris数据问题

1. 解决Key columns should be a ordered prefix of the schema. KeyColumns[1] (starts from zero) is xxx, but

背景

create table if not exists XXX (

    `fathercorp` varchar(50),

    `id` decimalv3(38,0)

    ) ENGINE=OLAP

UNIQUE KEY(`id`)

COMMENT 'xxxx'

DISTRIBUTED BY HASH(`id`) BUCKETS 10

PROPERTIES (

"replication_allocation" = "tag.location.default: 3",

"is_being_synced" = "false",

"storage_format" = "V2",

"enable_unique_key_merge_on_write" = "true",

"light_schema_change" = "true",

"store_row_column" = "true",

"disable_auto_compaction" = "false",

"enable_single_replica_compaction" = "false"

);

解决方案: 

将错误Key columns should be a ordered prefix of the schema. KeyColumns[1] (starts from zero) is aa, but corresponding column is bb in the previous columns declaration.

  由于UNIQUE KEY(`id`)中的字段必须为DDL建表语句的第一列,有顺序关系,然后问题解决

2.关于由于源表Oracle字段类型长度引起的错误

  

具体详细原因:

因为我们建表的时候,也是依据Oracle源表的字段长度进行建表的,如果在Doris中进行建表,字段长度类型尽可能的大一点,这样可以避免这种错误

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-19 15:18:03       70 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-19 15:18:03       74 阅读
  3. 在Django里面运行非项目文件

    2024-07-19 15:18:03       62 阅读
  4. Python语言-面向对象

    2024-07-19 15:18:03       72 阅读

热门阅读

  1. c语言(7.19)

    2024-07-19 15:18:03       24 阅读
  2. 关于UniApp使用的个人笔记

    2024-07-19 15:18:03       19 阅读
  3. Qt之基础体系

    2024-07-19 15:18:03       16 阅读
  4. Git笔记

    Git笔记

    2024-07-19 15:18:03      20 阅读
  5. 简单分享下Python数据可视化

    2024-07-19 15:18:03       21 阅读
  6. 【LeetCode 0022】【DSF】生成括号

    2024-07-19 15:18:03       24 阅读
  7. 【Nginx】前端请求跨域问题

    2024-07-19 15:18:03       22 阅读