zclllyybb commented on PR #31312:
URL: https://github.com/apache/doris/pull/31312#issuecomment-1963602141

   > > > > need more discuss. hold on now. we may need a complete fix on 
planner to prohibit `string` to `array<string>`. @morrySnow PTAL
   > > > 
   > > > 
   > > > @zclllyybb @morrySnow Do we still need to discuss it? Perhaps you can 
provide me with an example so that I can fix it in the next PR.
   > > 
   > > 
   > > I think the better way is totally forbid implicit casting from `string` 
to `array<string>` when do type coercion for function signature matches, rather 
than use a special set `STRING_SEARCH_FUNCTION_SET` to avoid this. could you 
please handle this? or you can just fix the origin problem and leave it as a 
individual task
   > 
   > Completely forbid implicit casting may affect many behaviors. For example, 
should we ban the following case?
   > 
   > case: implicit casting in insert stmt
   > 
   > ```
   > MySQL [test]> desc tbl2;
   > +-------+-------------+------+-------+---------+---------+
   > | Field | Type        | Null | Key   | Default | Extra   |
   > +-------+-------------+------+-------+---------+---------+
   > | ka    | INT         | Yes  | true  | NULL    |         |
   > | kb    | TEXT        | Yes  | false | NULL    | REPLACE |
   > | kc    | ARRAY<TEXT> | Yes  | false | NULL    | REPLACE |
   > +-------+-------------+------+-------+---------+---------+
   > 3 rows in set (0.01 sec)
   > 
   > MySQL [test]> insert into tbl2 values(1, '123', '[123,123]');
   > Query OK, 1 row affected (0.07 sec)
   > {'label':'insert_6e5f2205983f49a7_8767898ea1995eb2', 'status':'VISIBLE', 
'txnId':'12019'}
   > ```
   > 
   > And I think implicitly casting string to other type is a tradition in 
doris (ex. string->(int, date,jsonb)), but unfortunately not in Clickhouse, if 
we want to change it, we really need more discuss about it, may be I should 
leave it as an individual task.
   
   1. cast `string` to another type is acceptable. but to 
`array<string>`(generally, to all type which have a subtype of string) is a 
special case. the users may not sure what they are doing, like '[1,2,3]' means 
['1','2','3'] or ['[1,2,3]']? for this particular scenario, maybe forbid to 
implicit cast is a good decision. If they need, could use a more clear way or 
explicit cast.
   2. for functions' match, we can individually deal some of the type coercion 
rules. so there still need more discussion about if we should change the 
scenario you mentioned together.
   
   looking forward for more opinion!


-- 
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