matrixorigin / matrixorigin/matrixone
[Bug]: EXTRACT(YEAR FROM a) can not be as hash key in partition table
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 311
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 768
Description
### Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
### Branch Name
main
### Commit ID
afd7c53370cd67a1b21b84e2463ce60702493d06
### Other Environment Information
```Markdown
- Hardware parameters:
- OS type:
- Others:
```
### Actual Behavior
mysql> CREATE TABLE t1 (a DATETIME)
-> PARTITION BY HASH (EXTRACT(YEAR FROM a));
ERROR 1491 (HY000): The PARTITION function returns the wrong type
mysql:
mysql> CREATE TABLE t1 (a DATETIME)
-> PARTITION BY HASH (EXTRACT(YEAR FROM a));
Query OK, 0 rows affected (0.03 sec)
### Expected Behavior
_No response_
### Steps to Reproduce
```Markdown
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(YEAR FROM a));
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.