You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "jduo (via GitHub)" <gi...@apache.org> on 2024/06/21 14:22:18 UTC

[PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

jduo opened a new pull request, #3826:
URL: https://github.com/apache/calcite/pull/3826

   Fix errors about the code size being too large for a method when joining thousands of fields.


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1672617912


##########
core/src/main/java/org/apache/calcite/interpreter/Row.java:
##########
@@ -86,6 +86,8 @@ public static Row of(@Nullable Object...values) {
   }
 
   /** Returns a copy of the values. */
+  // Note: This implements BuildInMethod.ROW_COPY_VALUES.
+  @SuppressWarnings("unused")

Review Comment:
   There are lots of methods like this in the code, which are called using reflection.
   I like the idea of using this annotation, but is there a guideline about which annotations should be used and which ones shouldn't?



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094] Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "rubenada (via GitHub)" <gi...@apache.org>.
rubenada commented on PR #3826:
URL: https://github.com/apache/calcite/pull/3826#issuecomment-2225111951

   @mihaibudiu (or the others), is there any further comment? I think it looks in a good shape for merge (after squashing commits into a single one)


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094] Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #3826:
URL: https://github.com/apache/calcite/pull/3826#issuecomment-2225958725

   I have no other comments.


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "normanj-bitquill (via GitHub)" <gi...@apache.org>.
normanj-bitquill commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1664546778


##########
core/src/test/java/org/apache/calcite/test/LargeGeneratedJoinTest.java:
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.test;
+
+import org.apache.calcite.adapter.enumerable.EnumerableRules;
+import org.apache.calcite.adapter.java.AbstractQueryableTable;
+import org.apache.calcite.config.CalciteConnectionProperty;
+import org.apache.calcite.config.Lex;
+import org.apache.calcite.interpreter.Row;
+import org.apache.calcite.jdbc.CalciteSchema;
+import org.apache.calcite.linq4j.Enumerable;
+import org.apache.calcite.linq4j.Linq4j;
+import org.apache.calcite.linq4j.QueryProvider;
+import org.apache.calcite.linq4j.Queryable;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.runtime.Hook;
+import org.apache.calcite.schema.QueryableTable;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Table;
+import org.apache.calcite.schema.impl.AbstractSchema;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.tools.RelConversionException;
+import org.apache.calcite.tools.ValidationException;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Test class for CALCITE-3094.

Review Comment:
   Updated.



##########
core/src/test/java/org/apache/calcite/test/LargeGeneratedJoinTest.java:
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.test;
+
+import org.apache.calcite.adapter.enumerable.EnumerableRules;
+import org.apache.calcite.adapter.java.AbstractQueryableTable;
+import org.apache.calcite.config.CalciteConnectionProperty;
+import org.apache.calcite.config.Lex;
+import org.apache.calcite.interpreter.Row;
+import org.apache.calcite.jdbc.CalciteSchema;
+import org.apache.calcite.linq4j.Enumerable;
+import org.apache.calcite.linq4j.Linq4j;
+import org.apache.calcite.linq4j.QueryProvider;
+import org.apache.calcite.linq4j.Queryable;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.runtime.Hook;
+import org.apache.calcite.schema.QueryableTable;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Table;
+import org.apache.calcite.schema.impl.AbstractSchema;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.tools.RelConversionException;
+import org.apache.calcite.tools.ValidationException;
+
+import com.google.common.collect.ImmutableMap;
+
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Test class for CALCITE-3094.
+ */
+public class LargeGeneratedJoinTest {
+
+  /**
+   * Marker interface for Field.
+   */
+  interface FieldT extends BiConsumer<RelDataTypeFactory, RelDataTypeFactory.Builder> {
+  }
+
+  /**
+   * Marker interface for Row.
+   */
+  interface RowT extends Function<RelDataTypeFactory, RelDataType> {
+  }
+
+  static FieldT field(String name) {
+    return (tf, b) -> b.add(name, SqlTypeName.VARCHAR);
+  }
+
+  static RowT row(FieldT... fields) {
+    return tf -> {
+      RelDataTypeFactory.Builder builder = tf.builder();
+      for (FieldT f : fields) {
+        f.accept(tf, builder);
+      }
+      return builder.build();
+    };
+  }
+
+  private static QueryableTable tab(int fieldCount) {
+    List<Row> lRow = new ArrayList<>();
+    for (int r = 0; r < 2; r++) {
+      Object[] current = new Object[fieldCount];
+      for (int i = 0; i < fieldCount; i++) {
+        current[i] = "v" + i;
+      }
+      lRow.add(Row.of(current));
+    }
+
+    List<FieldT> fields = new ArrayList<>();
+    for (int i = 0; i < fieldCount; i++) {
+      fields.add(field("F_" + i));
+    }
+
+    final Enumerable<?> enumerable = Linq4j.asEnumerable(lRow);
+    return new AbstractQueryableTable(Row.class) {
+
+      @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) {
+        return row(fields.toArray(new FieldT[fieldCount])).apply(typeFactory);
+      }
+
+      @Override public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema,
+          String tableName) {
+        return (Queryable<T>) enumerable.asQueryable();
+      }
+    };
+  }
+
+  @Test public void test() throws SqlParseException, RelConversionException, ValidationException {
+    Schema rootSchema = new AbstractSchema() {
+      @Override protected Map<String, Table> getTableMap() {
+        return ImmutableMap.of("T0", tab(100),
+            "T1", tab(101));
+      }
+    };
+
+    final CalciteSchema sp = CalciteSchema.createRootSchema(false, true);
+    sp.add("ROOT", rootSchema);
+
+    String sql = "SELECT * \n"
+        + "FROM ROOT.T0 \n"
+        + "JOIN ROOT.T1 \n"
+        // + "ON ROOT.T0.F_0 = ROOT.T1.F_0";

Review Comment:
   Removed.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3826:
URL: https://github.com/apache/calcite/pull/3826#issuecomment-2221174131

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=3826) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [3 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=3826&resolved=false&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=3826&resolutions=WONTFIX)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=3826&resolved=false&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [77.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=3826&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=3826&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=3826)
   
   


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on PR #3826:
URL: https://github.com/apache/calcite/pull/3826#issuecomment-2221133480

   > Is this now working end-to-end?
   
   This is working end-to-end. I've also beefed up the supplied test to validate the data from the join result.


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1669461233


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java:
##########
@@ -189,6 +233,15 @@ static Expression joinSelector(JoinRelType joinType, PhysType physType,
         expressions.add(expression);
       }
     }
+
+    if (generateCompactCode) {

Review Comment:
   @mihaibudiu I think your comments are now addressed. Thanks!



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094] Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "rubenada (via GitHub)" <gi...@apache.org>.
rubenada merged PR #3826:
URL: https://github.com/apache/calcite/pull/3826


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "thomasrebele (via GitHub)" <gi...@apache.org>.
thomasrebele commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1666061332


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java:
##########
@@ -189,6 +233,15 @@ static Expression joinSelector(JoinRelType joinType, PhysType physType,
         expressions.add(expression);
       }
     }
+
+    if (generateCompactCode) {

Review Comment:
   Indeed, I had not implemented `JavaRowFormat.copy()`, as I didn't know how to do that. Seems that the input would be `org.apache.calcite.interpreter.Row` according to the generated code. I'm astonished that the return type is not of the same type.
   The `JavaRowFormat.copy()` would need to return an `Expression` that represents the code to copy the data from the left and right `org.apache.calcite.interpreter.Row`. Not sure whether an `ARRAY_COPY` could be used here. Alternatively, the generated code could be a for loop, here some pseudo-code:
   ```
   int outIdx = 0;
   for(int leftIdx = 0; leftIdx < left length; leftIdx++) {
     outputArray[outIdx++] = left item at position leftIdx;
   }
   for(int rightIdx = 0; rightIdx < right length; rightIdx++) {
     outputArray[outIdx++] = right item at position rightIdx;
   }
   ```



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "normanj-bitquill (via GitHub)" <gi...@apache.org>.
normanj-bitquill commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1664547504


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/JavaRowFormat.java:
##########
@@ -256,6 +262,25 @@ public enum JavaRowFormat {
       }
       return EnumUtils.convert(e, fromType, fieldType);
     }
+
+    @Override public Expression fieldDynamic(Expression expression, Expression field) {
+      return Expressions.arrayIndex(expression, field);
+    }
+
+    @Override public Expression setFieldDynamic(Expression expression, Expression field,
+        Expression value) {
+      final IndexExpression e =
+          Expressions.arrayIndex(expression, Expressions.constant(field));
+      return Expressions.assign(e, value);
+    }
+
+    @Override public @Nullable Expression copy(ParameterExpression parameter,
+        ParameterExpression outputArray, int outputStartIndex, int length) {
+

Review Comment:
   Removed.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1672739862


##########
core/src/main/java/org/apache/calcite/interpreter/Row.java:
##########
@@ -86,6 +86,8 @@ public static Row of(@Nullable Object...values) {
   }
 
   /** Returns a copy of the values. */
+  // Note: This implements BuildInMethod.ROW_COPY_VALUES.
+  @SuppressWarnings("unused")

Review Comment:
   I'm not sure if there's a guideline for this in Calcite.
   In other projects I've seen this annotation used to mark methods that are called via reflection or not used internally but needed in the public API to prevent accidental removal due to refactoring. It also has the nice side-effect of un-graying out in IDEs such as IntelliJ.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1669447264


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java:
##########
@@ -189,6 +233,15 @@ static Expression joinSelector(JoinRelType joinType, PhysType physType,
         expressions.add(expression);
       }
     }
+
+    if (generateCompactCode) {

Review Comment:
   I've changed copy to generate the following code:
   
   ```
   new org.apache.calcite.linq4j.function.Function2() {
     public String[] apply(org.apache.calcite.interpreter.Row left, org.apache.calcite.interpreter.Row right) {
       String[] outputArray = new String[201];
       System.arraycopy(left.copyValues(), 0, outputArray, 0, 101);
       System.arraycopy(right.copyValues(), 0, outputArray, 101, 100);
       return outputArray;
     }
     public String[] apply(Object left, Object right) {
       return apply(
         (org.apache.calcite.interpreter.Row) left,
         (org.apache.calcite.interpreter.Row) right);
     }
   }
   ```
   
   I'll add that to the comments.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "jduo (via GitHub)" <gi...@apache.org>.
jduo commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1669447264


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java:
##########
@@ -189,6 +233,15 @@ static Expression joinSelector(JoinRelType joinType, PhysType physType,
         expressions.add(expression);
       }
     }
+
+    if (generateCompactCode) {

Review Comment:
   I've changed copy to generate the following code:
   
   `new org.apache.calcite.linq4j.function.Function2() {
     public String[] apply(org.apache.calcite.interpreter.Row left, org.apache.calcite.interpreter.Row right) {
       String[] outputArray = new String[201];
       System.arraycopy(left.copyValues(), 0, outputArray, 0, 101);
       System.arraycopy(right.copyValues(), 0, outputArray, 101, 100);
       return outputArray;
     }
     public String[] apply(Object left, Object right) {
       return apply(
         (org.apache.calcite.interpreter.Row) left,
         (org.apache.calcite.interpreter.Row) right);
     }
   }
   `
   
   I'll add that to the comments.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "normanj-bitquill (via GitHub)" <gi...@apache.org>.
normanj-bitquill commented on code in PR #3826:
URL: https://github.com/apache/calcite/pull/3826#discussion_r1664545435


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java:
##########
@@ -189,6 +233,15 @@ static Expression joinSelector(JoinRelType joinType, PhysType physType,
         expressions.add(expression);
       }
     }
+
+    if (generateCompactCode) {

Review Comment:
   @thomasrebele 
   
   Here is the code generated from a unit test.
   ```
   {
     return org.apache.calcite.linq4j.EnumerableDefaults.nestedLoopJoin(org.apache.calcite.schema.Schemas.queryable(root, root.getRootSchema().getSubSchema("ROOT"), org.apache.calcite.interpreter.Row.class, "T1").asEnumerable(), org.apache.calcite.schema.Schemas.queryable(root, root.getRootSchema().getSubSchema("ROOT"), org.apache.calcite.interpreter.Row.class, "T0").asEnumerable(), new org.apache.calcite.linq4j.function.Predicate2() {
         public boolean apply(org.apache.calcite.interpreter.Row left, org.apache.calcite.interpreter.Row right) {
           return true;
         }
         public boolean apply(Object left, Object right) {
           return apply(
             (org.apache.calcite.interpreter.Row) left,
             (org.apache.calcite.interpreter.Row) right);
         }
       }
       , new org.apache.calcite.linq4j.function.Function2() {
         public String[] apply(org.apache.calcite.interpreter.Row left, org.apache.calcite.interpreter.Row right) {
           String[] outputArray = new String[201];
           return outputArray;
         }
         public String[] apply(Object left, Object right) {
           return apply(
             (org.apache.calcite.interpreter.Row) left,
             (org.apache.calcite.interpreter.Row) right);
         }
       }
       , org.apache.calcite.linq4j.JoinType.INNER);
   }
   ```
   
   This is just returning an initialized String array of the correct size. The data isn't copied.
   
   The issue could be from here:
   https://github.com/Bit-Quill/calcite/blob/calcite-3094-method-too-large/core/src/main/java/org/apache/calcite/adapter/enumerable/JavaRowFormat.java#L347
   
   What should `JavaRowFormat.copy()` return?



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [CALCITE-3094]: Code of method grows beyond 64 KB when joining two tables with many fields [calcite]

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3826:
URL: https://github.com/apache/calcite/pull/3826#issuecomment-2206933570

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=3826) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [2 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=3826&resolved=false&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=3826&resolutions=WONTFIX)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=3826&resolved=false&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [75.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=3826&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=3826&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=3826)
   
   


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org