lowka commented on code in PR #2857:
URL: https://github.com/apache/ignite-3/pull/2857#discussion_r1410581250
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java:
##########
@@ -301,6 +704,29 @@ public Stream<DynamicTest> testFunction() {
);
}
+ /** Set operations. */
+ @TestFactory
+ public Stream<DynamicTest> testSetOps() {
+ return Stream.of(
+ sql("SELECT 1 UNION SELECT ?", 1)
+ .parameterTypes(nullable(NativeTypes.INT32))
+ .ok(),
+
+ sql("SELECT 1 UNION SELECT ?", Unspecified.UNKNOWN)
+ .fails("Unable to determine type of a dynamic
parameter#0."),
+
+ sql("SELECT ? UNION SELECT 1", 1)
+ .parameterTypes(nullable(NativeTypes.INT32))
+ .ok(),
+
+ sql("SELECT ? UNION SELECT 1", Unspecified.UNKNOWN)
+ .fails("Unable to determine type of a dynamic
parameter#0."),
+
+ sql("SELECT ? UNION SELECT ?", 1, Unspecified.UNKNOWN)
+ .fails("Unable to determine type of a dynamic
parameter#1.")
Review Comment:
>You have a test that expects INT32 type, but here is a Long (INT64).
Well, The correct answer to this question should be:
The test expect that the statement `SELECT ? UNION SELECT ?` works. if of
one parameter is an integer and another is a bigint. Nothing more, nothing less.
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DynamicParametersTest.java:
##########
@@ -301,6 +704,29 @@ public Stream<DynamicTest> testFunction() {
);
}
+ /** Set operations. */
+ @TestFactory
+ public Stream<DynamicTest> testSetOps() {
+ return Stream.of(
+ sql("SELECT 1 UNION SELECT ?", 1)
+ .parameterTypes(nullable(NativeTypes.INT32))
+ .ok(),
+
+ sql("SELECT 1 UNION SELECT ?", Unspecified.UNKNOWN)
+ .fails("Unable to determine type of a dynamic
parameter#0."),
+
+ sql("SELECT ? UNION SELECT 1", 1)
+ .parameterTypes(nullable(NativeTypes.INT32))
+ .ok(),
+
+ sql("SELECT ? UNION SELECT 1", Unspecified.UNKNOWN)
+ .fails("Unable to determine type of a dynamic
parameter#0."),
+
+ sql("SELECT ? UNION SELECT ?", 1, Unspecified.UNKNOWN)
+ .fails("Unable to determine type of a dynamic
parameter#1.")
Review Comment:
>You have a test that expects INT32 type, but here is a Long (INT64).
Well, The correct answer to this question should be:
The test expects that the statement `SELECT ? UNION SELECT ?` works. if of
one parameter is an integer and another is a bigint. Nothing more, nothing less.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]