liuyongvs commented on code in PR #3231:
URL: https://github.com/apache/calcite/pull/3231#discussion_r1210942800
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -827,6 +828,47 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding
operatorBinding,
.withOperandTypeInference(InferTypes.RETURN_TYPE)
.withKind(SqlKind.CONCAT2);
+ private static RelDataType namedStructReturnType(SqlOperatorBinding
operatorBinding) {
+ if (operatorBinding.getOperandCount() < 2) {
+ throw
operatorBinding.newError(Static.RESOURCE.namedStructRequiresTwoOrMoreArgs());
+ }
+ if (operatorBinding.getOperandCount() % 2 != 0) {
+ throw
operatorBinding.newError(Static.RESOURCE.namedStructRequiresEvenNumberOfArgs());
+ }
+ List<String> keys = new ArrayList<String>();
+ List<RelDataType> values = new ArrayList<RelDataType>();
Review Comment:
calcite try best to using final,
final List<String> keys
final List<RelDataType> values
--
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]