Open MicePilot opened 6 months ago
It may be solved in the commit https://github.com/StarRocks/starrocks/commit/64faf9074ad6943f72daee23fc6c6d7d8cc5291f, I will try it.
It may be solved in the commit 64faf90, I will try it.
No, the problem still exists
We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!
Steps to reproduce the behavior (Required)
select if(true, struct('xx','ss'), null);
Expected behavior (Required)
The result should be: {"col1":"xx", "col2":"ss"}
Real behavior (Required)
ERROR 1064 (HY000): Getting analyzing error from line 1, column 7 to line 1, column 39. Detail message: No matching function with signature: if(boolean, struct<col1 varchar, col2 varchar>, NULL_TYPE).
StarRocks version (Required)
select current_version()
3.2.0
This may be caused by
com.starrocks.sql.analyzer.PolymorphicFunctionAnalyzer.resolveArgTypes
as it treats NULL as struct{boolean} type, when the second parameter of the if function is struct{string,string}, incom.starrocks.sql.analyzer.PolymorphicFunctionAnalyzer.IfDeduce
, the commonType will be INVALID, and then an error will be reported when searching for functions of this type.