Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
zstan merged PR #12743: URL: https://github.com/apache/ignite/pull/12743 -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
alex-plekhanov commented on code in PR #12743:
URL: https://github.com/apache/ignite/pull/12743#discussion_r2825872030
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java:
##
@@ -113,6 +121,21 @@ private void connect(String url) throws Exception {
stopAllGrids();
}
+/** Test user defined table through jdbc. */
+@Test
+public void testUdt() throws Exception {
+try (PreparedStatement ps = conn.prepareStatement("SELECT * FROM
TABLE(\"OWN_SCHEMA\".STR_ARRAY_CONSUME_TABLE(?))")) {
+ps.setObject(1, List.of("row1", "row2"));
+ResultSet rs = ps.executeQuery();
+
+assertTrue(rs.next());
+assertEquals("row1", rs.getString(1));
+
+assertTrue(rs.next());
+assertEquals("row2", rs.getString(1));
+}
Review Comment:
`assertFalse(rs.next());`? Up to you.
--
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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3920923742 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3918636136 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3914582609 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate failed** Failed conditions  [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) (required ≤ 1) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) ##  Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3912827873 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
tkalkirill commented on code in PR #12743:
URL: https://github.com/apache/ignite/pull/12743#discussion_r2815360155
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java:
##
@@ -105,18 +105,25 @@ public void testSystemFunctionOverriding() throws
Exception {
// Make sure that the new functions didn't affect schema 'PUBLIC'.
assertQuery("SELECT
UPPER(?)").withParams("abc").returns("ABC").check();
-assertQuery("select UNIX_SECONDS(TIMESTAMP '2021-01-01
00:00:00')").returns(1609459200L).check();
-assertQuery("select * from table(SYSTEM_RANGE(1,
2))").returns(1L).returns(2L).check();
-assertQuery("select
TYPEOF(?)").withParams(1L).returns("BIGINT").check();
-assertQuery("select ? + ?").withParams(1, 2).returns(3).check();
-assertThrows("select PLUS(?, ?)", SqlValidatorException.class, "No
match found for function signature", 1, 2);
+assertQuery("SELECT UNIX_SECONDS(TIMESTAMP '2021-01-01
00:00:00')").returns(1609459200L).check();
Review Comment:
In my opinion, these changes are redundant within the scope of the
documentation ticket and are not related to this issue.
From my experience, when looking at the diff, it's better to see the ticket
where the change occurred and made sense, rather than having to delve into an
unrelated PR and look through everything there to figure it out.
In my opinion, it's better not to do this in this ticket.
Refactoring and other issues should be a separate ticket.
I'm not insisting it's up to you.
--
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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3912433252 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate failed** Failed conditions  [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) (required ≤ 1) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) ##  Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
zstan commented on code in PR #12743:
URL: https://github.com/apache/ignite/pull/12743#discussion_r2815057772
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java:
##
@@ -105,18 +105,25 @@ public void testSystemFunctionOverriding() throws
Exception {
// Make sure that the new functions didn't affect schema 'PUBLIC'.
assertQuery("SELECT
UPPER(?)").withParams("abc").returns("ABC").check();
-assertQuery("select UNIX_SECONDS(TIMESTAMP '2021-01-01
00:00:00')").returns(1609459200L).check();
-assertQuery("select * from table(SYSTEM_RANGE(1,
2))").returns(1L).returns(2L).check();
-assertQuery("select
TYPEOF(?)").withParams(1L).returns("BIGINT").check();
-assertQuery("select ? + ?").withParams(1, 2).returns(3).check();
-assertThrows("select PLUS(?, ?)", SqlValidatorException.class, "No
match found for function signature", 1, 2);
+assertQuery("SELECT UNIX_SECONDS(TIMESTAMP '2021-01-01
00:00:00')").returns(1609459200L).check();
Review Comment:
why not to align all these stuff here ?
--
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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
tkalkirill commented on code in PR #12743:
URL: https://github.com/apache/ignite/pull/12743#discussion_r2814879174
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java:
##
@@ -105,18 +105,25 @@ public void testSystemFunctionOverriding() throws
Exception {
// Make sure that the new functions didn't affect schema 'PUBLIC'.
assertQuery("SELECT
UPPER(?)").withParams("abc").returns("ABC").check();
-assertQuery("select UNIX_SECONDS(TIMESTAMP '2021-01-01
00:00:00')").returns(1609459200L).check();
-assertQuery("select * from table(SYSTEM_RANGE(1,
2))").returns(1L).returns(2L).check();
-assertQuery("select
TYPEOF(?)").withParams(1L).returns("BIGINT").check();
-assertQuery("select ? + ?").withParams(1, 2).returns(3).check();
-assertThrows("select PLUS(?, ?)", SqlValidatorException.class, "No
match found for function signature", 1, 2);
+assertQuery("SELECT UNIX_SECONDS(TIMESTAMP '2021-01-01
00:00:00')").returns(1609459200L).check();
Review Comment:
I don't think these changes are necessary to this ticket, it's at your
discretion, of course.
##
modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java:
##
@@ -2639,6 +2640,15 @@ public static long sleep_and_can_fail(long sleepMs,
boolean fail) {
return sleep;
}
+
+/** Function consume String array and output it row by row. */
+@QuerySqlTableFunction(alias = "STR_ARRAY_CONSUME_TABLE", columnTypes
= {String.class}, columnNames = {"RESULT"})
+public static Iterable strArrConsumeTable(List
array) {
Review Comment:
I wouldn't put this code into utilities, it doesn't look like a utility, but
rather like a test case.
--
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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3908667895 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
zstan commented on code in PR #12743:
URL: https://github.com/apache/ignite/pull/12743#discussion_r2812165758
##
modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlTableFunction.java:
##
@@ -45,7 +45,7 @@
* cacheCfg.setSqlFunctionClasses(MyTableFunctions.class);
*
* // And use in queries.
- * cache.query(new SqlFieldsQuery("select S_VAL from MY_TABLE(1, 5.0f,
"ext") where F_VAL is not null"));
+ * cache.query(new SqlFieldsQuery("select S_VAL from TABLE(MY_TABLE(1,
5.0f, "ext")) where F_VAL is not null"));
Review Comment:
done
--
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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3908120916 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3908081795 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate failed** Failed conditions  [3 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) (required ≤ 1) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) ##  Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3908023761 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate failed** Failed conditions  [3 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) (required ≤ 1) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) ##  Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request) -- 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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
tkalkirill commented on code in PR #12743:
URL: https://github.com/apache/ignite/pull/12743#discussion_r2811045358
##
modules/core/src/main/java/org/apache/ignite/cache/query/annotations/QuerySqlTableFunction.java:
##
@@ -45,7 +45,7 @@
* cacheCfg.setSqlFunctionClasses(MyTableFunctions.class);
*
* // And use in queries.
- * cache.query(new SqlFieldsQuery("select S_VAL from MY_TABLE(1, 5.0f,
"ext") where F_VAL is not null"));
+ * cache.query(new SqlFieldsQuery("select S_VAL from TABLE(MY_TABLE(1,
5.0f, "ext")) where F_VAL is not null"));
Review Comment:
It would be great if here or in the documentation you could describe how to
work with an array of objects in a function.
--
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]
Re: [PR] IGNITE-27836 Fix documentation for QuerySqlTableFunction [ignite]
sonarqubecloud[bot] commented on PR #12743: URL: https://github.com/apache/ignite/pull/12743#issuecomment-3906616601 ## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12743&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12743&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12743&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12743) -- 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]
