版本
doris-2.1.5-rc02-d5a02e095d
需要注意, 测试和生产环境的版本一样, 但下面的报错空指针只在生产中出现, 测试环境没有复现。
CREATE TABLE `ods_ocr_request_log_temp_01` (
`req_time` DATETIME(3) NULL COMMENT '请求时间',
`waybill_no` VARCHAR(5) NULL COMMENT '运单号',
`station_code` VARCHAR(100) NULL COMMENT '组织(驿站)code',
`express_code` VARCHAR(100) NULL COMMENT '快递公司code',
`receiver_name` VARCHAR(100) NULL COMMENT '三要素之一, 姓名识别结果',
`receiver_phone` VARCHAR(100) NULL COMMENT '三要素之一, 手机号识别结果',
`receiver_address` VARCHAR(1024) NULL COMMENT '三要素之一, 地址识别结果',
`image_quality_type` VARCHAR(100) NULL COMMENT '图片质量类型 no没有图片,invalid图片无效,blur图片模糊,clarity图片清晰',
`image_url` VARCHAR(512) NULL COMMENT '图片url地址'
) ENGINE=OLAP
UNIQUE KEY(`req_time`, `waybill_no`)
COMMENT 'ocr_ods请求日志明细'
PARTITION BY RANGE(`req_time`)()
DISTRIBUTED BY HASH(`waybill_no`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.group_etl: 3",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "day",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-50",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.group_etl: 3",
"dynamic_partition.buckets" = "1",
"dynamic_partition.create_history_partition" = "true",
"dynamic_partition.history_partition_num" = "-1",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V1",
"enable_unique_key_merge_on_write" = "true",
"light_schema_change" = "true",
"function_column.sequence_col" = "req_time",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728",
"enable_mow_light_delete" = "false"
);
-- insert into 明确且正常的报错。
insert into ods_ocr_request_log_temp_01
(req_time, waybill_no, station_code, express_code, receiver_name, receiver_phone, receiver_address, image_quality_type, image_url)
VALUES('2025-05-14 12:44:52', '超过字段设置字符串长度字符', '', '', '', '', '', '', '');
-- insert overwrite 全表覆写, 明确且正常的报错。
insert overwrite TABLE ods_ocr_request_log_temp_01
(req_time, waybill_no, station_code, express_code, receiver_name, receiver_phone, receiver_address, image_quality_type, image_url)
VALUES('2025-05-14 12:44:52', '超过字段设置字符串长度字符', '', '', '', '', '', '', '');
-- insert overwrite TABLE ... partition(*) 按分区覆写,
-- 返回的所有错误都为空指针异常,报错不明确。
insert overwrite TABLE ods_ocr_request_log_temp_01 partition(*)
(req_time, waybill_no, station_code, express_code, receiver_name, receiver_phone, receiver_address, image_quality_type, image_url)
VALUES('2025-05-14 12:44:52', '超过字段设置字符串长度字符', '', '', '', '', '', '', '');