You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/06 16:26:00 UTC
[jira] [Commented] (IGNITE-9197) Java thin client querying empty
table results in NoSuchElementException
[ https://issues.apache.org/jira/browse/IGNITE-9197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570432#comment-16570432 ]
ASF GitHub Bot commented on IGNITE-9197:
----------------------------------------
GitHub user kukushal opened a pull request:
https://github.com/apache/ignite/pull/4488
IGNITE-9197 Java thin client querying empty table results in NoSuchElementException
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gridgain/apache-ignite ignite-9197
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/4488.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4488
----
commit c07e904c8ac76daa5229fbb874c78b05378fe1e3
Author: Alexey Kukushkin <ku...@...>
Date: 2018-08-06T16:23:05Z
Initial revision
----
> Java thin client querying empty table results in NoSuchElementException
> -----------------------------------------------------------------------
>
> Key: IGNITE-9197
> URL: https://issues.apache.org/jira/browse/IGNITE-9197
> Project: Ignite
> Issue Type: Bug
> Components: thin client
> Affects Versions: 2.6
> Reporter: Alexey Kukushkin
> Assignee: Alexey Kukushkin
> Priority: Critical
> Fix For: 2.7
>
>
> +*Reproducer*+
> {code:java}
> @Test
> public void testGettingEmptyResultWhenQueryingEmptyTable() throws Exception {
> try (Ignite ignored = Ignition.start(Config.getServerConfiguration());
> IgniteClient client = Ignition.startClient(new ClientConfiguration().setAddresses(Config.SERVER))
> ) {
> final String TBL = "Person";
> client.query(
> new SqlFieldsQuery("CREATE TABLE IF NOT EXISTS " + TBL + " (id INT PRIMARY KEY, name VARCHAR)")
> ).getAll();
> List<List<?>> res = client.query(new SqlFieldsQuery("SELECT * FROM " + TBL)).getAll();
> assertNotNull(res);
> assertEquals(0, res.size());
> }
> }
> {code}
> *Expected*
> The test above should pass
> *Actual*
> java.util.NoSuchElementException
> at java.util.ArrayList$Itr.next(ArrayList.java:862)
> at org.apache.ignite.internal.client.thin.ClientQueryCursor$1.next(ClientQueryCursor.java:87)
> at org.apache.ignite.internal.client.thin.ClientQueryCursor.getAll(ClientQueryCursor.java:45)
> at org.apache.ignite.client.FunctionalQueryTest.testGettingEmptyResultWhenQueryingEmptyTable(FunctionalQueryTest.java:171)
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)