Skip to content

Commit 26d8f28

Browse files
committed
[FLINK-37924][table] Improve comments and formatting code
1 parent e7fe43b commit 26d8f28

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

flink-table/flink-sql-parser/src/main/java/org/apache/calcite/sql/fun/SqlItemOperator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
1718
package org.apache.calcite.sql.fun;
1819

1920
import org.apache.calcite.rel.type.RelDataType;
@@ -49,7 +50,7 @@
4950
* <p>This class was copied over from Calcite 1.39.0 version to support access variant
5051
* (FLINK-37924).
5152
*
52-
* <p>Line 148, CALCITE-7325, should be removed after upgrading Calcite to 1.42.0.
53+
* <p>Line 148 ~ 153, CALCITE-7325, should be removed after upgrading Calcite to 1.42.0.
5354
*/
5455
public class SqlItemOperator extends SqlSpecialOperator {
5556
public final int offset;
@@ -144,10 +145,12 @@ private static SqlSingleOperandTypeChecker getChecker(SqlCallBinding callBinding
144145
@Override
145146
public String getAllowedSignatures(String name) {
146147
if (name.equals("ITEM")) {
148+
// FLINK MODIFICATION BEGIN
147149
return "<ARRAY>[<INTEGER>]\n"
148150
+ "<MAP>[<ANY>]\n"
149151
+ "<ROW>[<CHARACTER>|<INTEGER>]\n"
150152
+ "<VARIANT>[<CHARACTER>|<INTEGER>]";
153+
// FLINK MODIFICATION END
151154
} else {
152155
return "<ARRAY>[" + name + "(<INTEGER>)]";
153156
}

flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/ItemAtIndexArgumentTypeStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
* <p>the type to be equal to the key type of {@link LogicalTypeRoot#MAP} if the first argument is a
4444
* map
4545
*
46-
* <p>a {@link LogicalTypeFamily#NUMERIC} type or {LogicalTypeFamily.CHARACTER_STRING} type if the
47-
* first argument is a {@link LogicalTypeRoot#VARIANT}.
46+
* <p>a {@link LogicalTypeFamily#NUMERIC} type or {@link LogicalTypeFamily#CHARACTER_STRING} type if
47+
* the first argument is a {@link LogicalTypeRoot#VARIANT}.
4848
*/
4949
@Internal
5050
public final class ItemAtIndexArgumentTypeStrategy implements ArgumentTypeStrategy {

flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import org.apache.flink.table.types.logical.utils.LogicalTypeUtils.toInternalCon
4343
import org.apache.flink.table.types.utils.DataTypeUtils.isInternal
4444
import org.apache.flink.table.utils.EncodingUtils
4545
import org.apache.flink.types.{ColumnList, Row, RowKind}
46-
import org.apache.flink.types.variant.{BinaryVariant, Variant}
46+
import org.apache.flink.types.variant.Variant
4747

4848
import java.lang.{Boolean => JBoolean, Byte => JByte, Double => JDouble, Float => JFloat, Integer => JInt, Long => JLong, Object => JObject, Short => JShort}
4949
import java.lang.reflect.Method

flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/VariantSemanticTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import static org.apache.flink.table.api.Expressions.$;
3838

3939
/** Semantic tests for {@link DataTypes#VARIANT()} type. */
40-
@SuppressWarnings("checkstyle:LocalFinalVariableName")
4140
public class VariantSemanticTest extends SemanticTestBase {
4241

4342
static final VariantBuilder BUILDER = Variant.newBuilder();

0 commit comments

Comments
 (0)