ihuzenko commented on a change in pull request #1374: [CALCITE-3138] 
Restructuring ROW type fields is not supported
URL: https://github.com/apache/calcite/pull/1374#discussion_r314293050
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/sql2rel/RelStructuredTypeFlattener.java
 ##########
 @@ -651,22 +609,57 @@ private void flattenProjection(RewriteRexShuttle shuttle,
         // NOTE jvs 10-Feb-2005:  This is a lame hack to keep special
         // functions which return row types working.
 
-        int j = 0;
         RexNode newExp = exp;
-        List<RexNode> oldOperands = ((RexCall) exp).getOperands();
-        if (oldOperands.get(0) instanceof RexInputRef) {
-          final RexInputRef inputRef = (RexInputRef) oldOperands.get(0);
-          final Ord<RelDataType> newField =
-              getNewFieldForOldInput(inputRef.getIndex());
-          newExp = rexBuilder.makeCall(exp.getType(),
-              ((RexCall) exp).getOperator(),
-              ImmutableList.of(rexBuilder.makeInputRef(newField.e, newField.i),
-                  oldOperands.get(1)));
-        }
-        for (RelDataTypeField field : newExp.getType().getFieldList()) {
-          flattenedExps.add(
-              Pair.of(rexBuilder.makeFieldAccess(newExp, field.getIndex()),
-                  fieldName + "$" + (j++)));
+        List<RexNode> operands = ((RexCall) exp).getOperands();
+
+        RexNode firstOp = operands.get(0);
+        RexNode secondOp = operands.get(1);
 
 Review comment:
   Fixed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to