ygerzhedovich commented on code in PR #4045:
URL: https://github.com/apache/ignite-3/pull/4045#discussion_r1669930000


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/datatypes/InsertSourcesCoercionTest.java:
##########
@@ -0,0 +1,665 @@
+/*
+ * 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.ignite.internal.sql.engine.planner.datatypes;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Stream;
+import org.apache.calcite.rex.RexNode;
+import 
org.apache.ignite.internal.sql.engine.planner.datatypes.utils.NumericPair;
+import org.apache.ignite.internal.sql.engine.planner.datatypes.utils.TypePair;
+import org.apache.ignite.internal.sql.engine.planner.datatypes.utils.Types;
+import org.apache.ignite.internal.sql.engine.rel.IgniteKeyValueModify;
+import org.apache.ignite.internal.sql.engine.rel.IgniteRel;
+import org.apache.ignite.internal.sql.engine.schema.IgniteSchema;
+import org.apache.ignite.internal.sql.engine.util.SqlTestUtils;
+import org.apache.ignite.internal.type.NativeTypeSpec;
+import org.apache.ignite.internal.type.NativeTypes;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+/**
+ * A set of test to verify behavior of type coercion for INSERT operations, 
when values belongs to the NUMERIC type family.
+ *
+ * <p>This tests aim to help to understand in which cases implicit cast will 
be added to which values.
+ */
+public class InsertSourcesCoercionTest extends BaseTypeCoercionTest {
+
+    @ParameterizedTest
+    @MethodSource("args")
+    public void insert(
+            TypePair pair,
+            Matcher<RexNode> operandMatcher
+    ) throws Exception {
+
+        IgniteSchema schema = createSchemaWithTwoColumnTable(pair.first(), 
pair.first());
+
+        Object val = 
SqlTestUtils.generateValueByType(pair.second().spec().asColumnType());
+
+        assertPlan("INSERT INTO T VALUES(" + val + "," + val + ")", schema, 
keyValOperandMatcher(operandMatcher)::matches, List.of());
+    }
+
+    @ParameterizedTest
+    @MethodSource("argsDyn")
+    public void insertDynamicParameters(
+            TypePair pair,
+            Matcher<RexNode> operandMatcher
+    ) throws Exception {
+        // ToDo: remove during implement IGNITE-22283

Review Comment:
   Always use the same approach. But anyway - amended to ``TODO``



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to