Thanks a lot! It works! 







At 2021-11-19 14:23:22, "陈明雨" <morning...@163.com> wrote:
>Your delete condition is a little bit complicated:
>ods_name_test='\''aa'\'' AND ods_address_test='\''ff'\'' AND 
>ods_age_test='\''12'\'' AND ods_message_test='\''cc'\'' AND 
>ods_id_test='\''1'\'''
>
>
>But maybe some of column data in delete condition is null? so that `null="aa"` 
>will return null, so that __DORIS_DELETE_SIGN__ will be assgine to null, which 
>encounter error.
>You can try this:
>
>
>--header 'delete: ods_name_test<=>'\''aa'\'' AND ods_address_test<=>'\''ff'\'' 
>AND ods_age_test<=>'\''12'\'' AND ods_message_test<=>'\''cc'\'' AND 
>ods_id_test<=>'\''1'\''' \
>
>
>Notice that we use "<=>", which is null-aware equal.
>
>
>null <=>  1  returns false
>null <=> null returns true
>1 <=> 1 returns true
>0 <=> 1 returns false
>
>
>
>
>--
>
>此致!Best Regards
>陈明雨 Mingyu Chen
>
>Email:
>chenmin...@apache.org
>
>
>
>
>在 2021-11-19 11:40:02,"温天柱" <wtz4...@163.com> 写道:
>
>一、场景描述
>使用版本:apache doris 0.14.x
>写入模式:stream-load
>场景:
>在通过http的方式,stream-load向doris写入数据,采用merge-type实现update的功能。
>(字段顺序为ods_id_test, ods_name_test, ods_messgae_test, ods_age_test, 
>ods_address_test)
>update之前的数据为
>1,aa,cc,12,ff
>预期之后的数据为
>1,aa,cc,12,(null)
>
>
>以下为http请求内容(已屏蔽敏感信息):
>curl --location --request PUT 
>'http://xxx.xxx.xxx.xxx:8040/api/test/ods_testOne/_stream_load' \
>--header 'Authorization: Basic xxxxxx=' \
>--header 'Expect: 100-continue' \
>--header 'Cookie: PALO_SESSION_ID=876x1c2d-xxxx-47b0-872a-xxadsfasdfs' \
>--header 'column_separator: ,' \
>--header 'columns: 
>ods_name_test,ods_address_test,ods_age_test,ods_message_test,ods_id_test' \
>--header 'line_separator: \n' \
>--header 'merge_type: MERGE' \
>--header 'delete: ods_name_test='\''aa'\'' AND ods_address_test='\''ff'\'' AND 
>ods_age_test='\''12'\'' AND ods_message_test='\''cc'\'' AND 
>ods_id_test='\''1'\''' \
>--header 'Content-Type: text/plain' \
>--data-raw 'aa,ff,12,cc,1
>aa,\N,12,cc,1'
>
>
>数据库中已存在一条数据
>
>
>数据库建表语句为:
>CREATE TABLE `ods_testOne` (
>  `ods_id_test` int(11) NULL COMMENT "",
>  `ods_name_test` varchar(255) NULL COMMENT "",
>  `ods_message_test` varchar(255) NULL COMMENT "",
>  `ods_age_test` int(11) NULL COMMENT "",
>  `ods_address_test` varchar(255) NULL COMMENT ""
>) ENGINE = OLAP UNIQUE KEY(`ods_id_test`) COMMENT "OLAP" DISTRIBUTED BY 
>HASH(`ods_id_test`) BUCKETS 10 PROPERTIES (
>  "replication_num" = "1",
>  "in_memory" = "false",
>  "storage_format" = "V2"
>);
>
>
>问题:发送写入request之后,doris返回了一条error_url,里面内容是:
>Reason: column(__DORIS_DELETE_SIGN__) value is null while columns is not 
>nullable. src line: [[(aa null 12 cc 1)]]; 
>
>
>请问这个问题是因为什么原因造成的呢?有什么解决方法吗?
>
>
>
>
> 

Reply via email to