[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ordering of columns during a join

Hi All,

As an experiment, I switched the order of inputs to
EnumerableDefaults::join_ during the implementation stage of
EnumerableJoin if the Join type is Inner. Since there will be no need
to generate nulls on either side, I would assume that the choice of
the side being built and the side being probed would not make a
difference in the result.

However, I see multiple test failures. On further investigation, I saw
that the failures are coming due to change in order of the columns and
due to the fact that a different column is being built now. For e.g.,
testInnerJoinValues fails with the following stack:

Caused by: java.lang.NumberFormatException: For input string: "SameName"
at java.base/java.lang.NumberFormatException.forInputString(
at java.base/java.lang.Integer.parseInt(
at java.base/java.lang.Integer.parseInt(
at org.apache.calcite.runtime.SqlFunctions.toInt(
at org.apache.calcite.runtime.SqlFunctions.toInt(
at Baz$4$1.moveNext(Unknown Source)
at org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(
at org.apache.calcite.linq4j.EnumerableDefaults.groupBy(
at org.apache.calcite.linq4j.DefaultEnumerable.groupBy(
at Baz.bind(Unknown Source)
at org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(
at org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(
at org.apache.calcite.jdbc.CalciteMetaImpl._createIterable(
at org.apache.calcite.jdbc.Calcite

Can someone please advise?

The current code is at: