tanclary commented on code in PR #3324:
URL: https://github.com/apache/calcite/pull/3324#discussion_r1268197316
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -955,10 +955,38 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding
operatorBinding,
.withKind(SqlKind.CONCAT_WS_MSSQL);
private static RelDataType arrayReturnType(SqlOperatorBinding opBinding) {
- RelDataType type =
- opBinding.getOperandCount() > 0
- ? ReturnTypes.LEAST_RESTRICTIVE.inferReturnType(opBinding)
- : opBinding.getTypeFactory().createUnknownType();
+ // only numeric & character types check
+ List<RelDataType> numericTypes = new ArrayList<>();
+ List<RelDataType> characterTypes = new ArrayList<>();
+ List<RelDataType> nullTypes = new ArrayList<>();
+ for (int i = 0; i < opBinding.getOperandCount(); i++) {
+ SqlTypeFamily family =
opBinding.getOperandType(i).getSqlTypeName().getFamily();
+ if (family == SqlTypeFamily.NUMERIC) {
Review Comment:
can this be rewritten as a switch case?
--
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]