qidaye opened a new issue #6578:
URL: https://github.com/apache/incubator-doris/issues/6578


   ### 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.
   
   
   ### Description
   
   In MySQL, it supports Integer-Types in like predicates.
   
   But Doris dose not support this feature, it will throw an exception where 
interge is in like predicate.
   
   ```sql
   -- MySQL 
   mysql> desc t2;
   +-------+--------------+------+-----+---------+-------+
   | Field | Type         | Null | Key | Default | Extra |
   +-------+--------------+------+-----+---------+-------+
   | k1    | tinyint(4)   | YES  |     | NULL    |       |
   | k2    | smallint(6)  | YES  |     | NULL    |       |
   | k3    | mediumint(9) | YES  |     | NULL    |       |
   | k4    | int(11)      | YES  |     | NULL    |       |
   | k5    | bigint(20)   | YES  |     | NULL    |       |
   +-------+--------------+------+-----+---------+-------+
   5 rows in set (0.00 sec)
   
   mysql>
   mysql>
   mysql> select * from t2 where k1 like '1%' and k2 like '1%' and k3 like '1%' 
and k4 like '1%' and k5 like '1%';
   +------+------+------+------+------+
   | k1   | k2   | k3   | k4   | k5   |
   +------+------+------+------+------+
   |  123 |  123 |  123 |  123 |  123 |
   +------+------+------+------+------+
   1 row in set (0.00 sec)
   
   -- Doris 
   
   mysql> select * from t1 where id like '1%';
   ERROR 1064 (HY000): errCode = 2, detailMessage = left operand of LIKE must 
be of type STRING: `id` LIKE '1%'
   ```
   
   ### Use case
   
   In order to keep the behavior of Doris and mysql consistent. 
   
   I'll add support for integer types in like predicate of Doris.
   
   ### Related issues
   
   _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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to