You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "didasai (via GitHub)" <gi...@apache.org> on 2023/11/20 10:27:11 UTC
[I] [Bug] 部分列更新默认值存在问题 [doris]
didasai opened a new issue, #27292:
URL: https://github.com/apache/doris/issues/27292
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
### Version
2.0.2
### What's Wrong?
表结构如下:
```
CREATE TABLE `report_dsp_date_user3` (
`m_date` date NOT NULL,
`dsp_id` char(20) NOT NULL DEFAULT "",
`uvrate` double REPLACE_IF_NOT_NULL NULL DEFAULT "0" COMMENT '',
`uvrate_bid` double REPLACE_IF_NOT_NULL NULL DEFAULT "0" COMMENT '',
`uv_showsuc` bigint(20) REPLACE_IF_NOT_NULL NULL DEFAULT "0" COMMENT '',
`uv_click` bigint(20) REPLACE_IF_NOT_NULL NULL DEFAULT "0" COMMENT '',
`crdate` datetime MIN NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=OLAP
AGGREGATE KEY(`m_date`, `dsp_id`)
COMMENT ''
PARTITION BY RANGE(`m_date`)
(PARTITION p20231108 VALUES [('2023-11-08'), ('2023-11-09')),
PARTITION p20231109 VALUES [('2023-11-09'), ('2023-11-10')),
PARTITION p20231110 VALUES [('2023-11-10'), ('2023-11-11')),
PARTITION p20231111 VALUES [('2023-11-11'), ('2023-11-12')),
PARTITION p20231112 VALUES [('2023-11-12'), ('2023-11-13')),
PARTITION p20231113 VALUES [('2023-11-13'), ('2023-11-14')),
PARTITION p20231114 VALUES [('2023-11-14'), ('2023-11-15')),
PARTITION p20231115 VALUES [('2023-11-15'), ('2023-11-16')),
PARTITION p20231116 VALUES [('2023-11-16'), ('2023-11-17')),
PARTITION p20231117 VALUES [('2023-11-17'), ('2023-11-18')),
PARTITION p20231118 VALUES [('2023-11-18'), ('2023-11-19')),
PARTITION p20231119 VALUES [('2023-11-19'), ('2023-11-20')),
PARTITION p20231120 VALUES [('2023-11-20'), ('2023-11-21')),
PARTITION p20231121 VALUES [('2023-11-21'), ('2023-11-22')),
PARTITION p20231122 VALUES [('2023-11-22'), ('2023-11-23')),
PARTITION p20231123 VALUES [('2023-11-23'), ('2023-11-24')))
DISTRIBUTED BY HASH(`dsp_id`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"is_being_synced" = "false",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-2147483648",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 3",
"dynamic_partition.buckets" = "32",
"dynamic_partition.create_history_partition" = "false",
"dynamic_partition.history_partition_num" = "-1",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"dynamic_partition.storage_medium" = "HDD",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
```
执行sql如下:
```
insert into report_dsp_date_user3(m_date,dsp_id,uvrate) values ('2023-11-20','wscs',1);
insert into report_dsp_date_user3(m_date,dsp_id,uvrate_bid) values ('2023-11-20','wscs',2);
```
执行后的结果如下:
```
m_date dsp_id uvrate uvrate_bid uv_showsuc uv_click crdate
2023-11-20 wscs 0 2 0 0 2023-11-20 18:12:17
```
问题说明:
```
没有实现部分列更新,在尝试修改默认值为null时,发现可以了,希望可以不设置默认值为null实现部分列更新
```
### What You Expected?
希望执行后的结果如下:
```
m_date dsp_id uvrate uvrate_bid uv_showsuc uv_click crdate
2023-11-20 wscs 1 2 0 0 2023-11-20 18:12:17
```
### How to Reproduce?
_No response_
### Anything Else?
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org
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
Re: [I] [Bug] 部分列更新默认值存在问题 [doris]
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman closed issue #27292: [Bug] 部分列更新默认值存在问题
URL: https://github.com/apache/doris/issues/27292
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
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
Re: [I] [Bug] 部分列更新默认值存在问题 [doris]
Posted by "didasai (via GitHub)" <gi...@apache.org>.
didasai commented on issue #27292:
URL: https://github.com/apache/doris/issues/27292#issuecomment-1820319203
> 如果您想要一个能够进行部分更新的表,并且表中的列可以具有非空默认值,则可以使用写入时合并唯一表。
AGGREGATE KEY模型,后续的版本会支持这种方式吗?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
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
Re: [I] [Bug] 部分列更新默认值存在问题 [doris]
Posted by "bobhan1 (via GitHub)" <gi...@apache.org>.
bobhan1 commented on issue #27292:
URL: https://github.com/apache/doris/issues/27292#issuecomment-1819338092
https://doris.apache.org/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-TABLE
> REPLACE_IF_NOT_NULL:非空值替换。和 REPLACE 的区别在于对于null值,不做替换。这里要注意的是字段默认值要给NULL,而不能是空字符串,如果是空字符串,会给你替换成空字符串。
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
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
Re: [I] [Bug] 部分列更新默认值存在问题 [doris]
Posted by "bobhan1 (via GitHub)" <gi...@apache.org>.
bobhan1 commented on issue #27292:
URL: https://github.com/apache/doris/issues/27292#issuecomment-1819333274
If you want a table that has the ability to do partial update, and columns in the table can have non-null default values, you can use a merge-on-write unique table.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
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
Re: [I] [Bug] 部分列更新默认值存在问题 [doris]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27292:
URL: https://github.com/apache/doris/issues/27292#issuecomment-3287230643
We're closing this issue because it hasn't been updated in a while.
If you'd like to revive this issue, please reopen it and feel free a maintainer to remove the Stale tag!
--
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.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
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