You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/10/19 03:39:40 UTC
[GitHub] [doris] MrChen222 opened a new issue, #13465: [Bug]
MrChen222 opened a new issue, #13465:
URL: https://github.com/apache/doris/issues/13465
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
### Version
1.1
### What's Wrong?
使用cast转换和date_format查询数据不一致
pay_time 是datetime类型用date_format(pay_time, '%Y-%m-%d') BETWEEN '2022-01-01' and '2022-08-31'可以查出数据,用cast(pay_time as date) BETWEEN '2022-01-01' and '2022-08-31'查不出数据。
### What You Expected?
期望修复这个bug,得到相同的结果
### How to Reproduce?
用date_format和cast分别转换datetime类型的字段使用ETWEEN '2022-01-01' and '2022-08-31' 一段时间出现BUG
### 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
[GitHub] [doris] nextdreamblue commented on issue #13465: [Bug] Cast as date query error
Posted by GitBox <gi...@apache.org>.
nextdreamblue commented on issue #13465:
URL: https://github.com/apache/doris/issues/13465#issuecomment-1288713604
produce:
MySQL [test]>
CREATE TABLE `canal_test1` (
`a` int(11) NOT NULL COMMENT "",
`b` datetime NOT NULL COMMENT ""
) ENGINE=OLAP
UNIQUE KEY(`a`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`a`) BUCKETS 8
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
);
MySQL [test]> insert into canal_test1 values(1,'2022-08-29 17:19:08');
MySQL [test]> insert into canal_test1 values(2,'2022-08-30 17:19:08');
MySQL [test]> insert into canal_test1 values(3,'2022-08-31 17:19:08');
MySQL [test]> select b from canal_test1 where cast(b as date) in ( '2022-08-31');
Empty set (0.01 sec)
MySQL [test]> select b from canal_test1 where cast(b as date) = '2022-08-31';
Empty set (0.01 sec)
MySQL [test]> select b from canal_test1 where cast(b as date) bETWEEN '2022-01-01' and '2022-08-31';
+---------------------+
| b |
+---------------------+
| 2022-08-30 17:19:08 |
| 2022-08-29 17:19:08 |
+---------------------+
2 rows in set (0.01 sec)
3个查询结果都不正确,应该都可以返回 2022-08-31 17:19:08
--
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] Cast as date query error [doris]
Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman closed issue #13465: [Bug] Cast as date query error
URL: https://github.com/apache/doris/issues/13465
--
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