[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user asfgit closed the pull request at: https://github.com/apache/incubator-rya/pull/285 ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user ejwhite922 commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/285#discussion_r178577153 --- Diff: extras/indexingExample/src/main/java/MongoRyaDirectExample.java --- @@ -805,6 +819,38 @@ public static void testAddAndDeleteNoContext(final SailRepositoryConnection conn Validate.isTrue(resultHandler.getCount() == 0); } +public static void testLubmFile(final SailRepositoryConnection conn) throws MalformedQueryException, RepositoryException, +UpdateExecutionException, QueryEvaluationException, TupleQueryResultHandlerException, RDFParseException, IOException { + +final String query = LubmQuery.LUBM_QUERY_14.getSparqlQuery(); +//"PREFIX lubm: <" + LUBM_PREFIX + "> \n" + --- End diff -- Done. ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user ejwhite922 commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/285#discussion_r178577147 --- Diff: extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java --- @@ -196,4 +203,74 @@ public void run() { // Show the read results matched the expected ones. assertEquals(expected, results); } + +@Test +public void runQueryFromFile() throws Exception { +// TODO: Maybe test with org.apache.rya.api.utils.LubmQuery.LUBM_QUERY_1,2,3,etc... --- End diff -- Removed ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user ejwhite922 commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/285#discussion_r178576981 --- Diff: extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java --- @@ -77,30 +77,39 @@ /** * This is the maximum value of a UTF-8 character. */ -private static final String END_RANGE_SUFFIX = new String(new byte[] { (byte) 0XFF }, Charsets.UTF_8); +private static final String END_RANGE_SUFFIX = new String(new byte[] { (byte) 0xFF }, Charsets.UTF_8); + +/** + * Indicates where the end of the join variables occurs. + */ +private static final String JOIN_VAR_END_MARKER = new String("~!^~".getBytes(Charsets.UTF_8), Charsets.UTF_8); --- End diff -- Done. Changed to 0x06,0x10,0x03,0x04. ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user kchilton2 commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/285#discussion_r178385888 --- Diff: extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java --- @@ -77,30 +77,39 @@ /** * This is the maximum value of a UTF-8 character. */ -private static final String END_RANGE_SUFFIX = new String(new byte[] { (byte) 0XFF }, Charsets.UTF_8); +private static final String END_RANGE_SUFFIX = new String(new byte[] { (byte) 0xFF }, Charsets.UTF_8); + +/** + * Indicates where the end of the join variables occurs. + */ +private static final String JOIN_VAR_END_MARKER = new String("~!^~".getBytes(Charsets.UTF_8), Charsets.UTF_8); --- End diff -- I'm not sure that the marker should be in the visually renderable byte ranges since, while very unlikely, they could legitimately appear in the data that is being indexed. ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user isper3at commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/285#discussion_r178368019 --- Diff: extras/indexingExample/src/main/java/MongoRyaDirectExample.java --- @@ -805,6 +819,38 @@ public static void testAddAndDeleteNoContext(final SailRepositoryConnection conn Validate.isTrue(resultHandler.getCount() == 0); } +public static void testLubmFile(final SailRepositoryConnection conn) throws MalformedQueryException, RepositoryException, +UpdateExecutionException, QueryEvaluationException, TupleQueryResultHandlerException, RDFParseException, IOException { + +final String query = LubmQuery.LUBM_QUERY_14.getSparqlQuery(); +//"PREFIX lubm: <" + LUBM_PREFIX + "> \n" + --- End diff -- remove commented out code ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
Github user isper3at commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/285#discussion_r178368138 --- Diff: extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java --- @@ -196,4 +203,74 @@ public void run() { // Show the read results matched the expected ones. assertEquals(expected, results); } + +@Test +public void runQueryFromFile() throws Exception { +// TODO: Maybe test with org.apache.rya.api.utils.LubmQuery.LUBM_QUERY_1,2,3,etc... --- End diff -- remove TODO? ---
[GitHub] incubator-rya pull request #285: RYA-469 Added tests for Rya Streams join it...
GitHub user ejwhite922 opened a pull request: https://github.com/apache/incubator-rya/pull/285 RYA-469 Added tests for Rya Streams join iterator bug using LUBM data. ## Description Joins were not working in Rya Streams. The KeyValueJoinStateStore needed to have a queryId associated with each row in RocksDB. Also, the range search that returned the RocksDB iterator needed to mark where the join variables ended so the results would not include characters that came after the start and end range markers (i.e. a range search from "urn:Student9[0x00]" to "urn:Student9[0xFF]" would incorrectly include "urn:Student95,[remainingBindingResults]" when we only wanted rows for "urn:Student9"). ### Tests LUBM data and queries were added for testing. Unit Tests ### Links [Jira](https://issues.apache.org/jira/browse/RYA-469) ### Checklist - [ ] Code Review - [ ] Squash Commits People To Review @isper3at @kchilton2 @pujav65 @meiercaleb @amihalik @DLotts @jessehatfield You can merge this pull request into a Git repository by running: $ git pull https://github.com/ejwhite922/incubator-rya RYA-469_RyaStreamsJoinIteratorBug Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-rya/pull/285.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 #285 commit a6c9bf8604705ece21d68543cd7bcc1ea252204a Author: eric.whiteDate: 2018-03-29T19:32:56Z RYA-469 Added tests for Rya Streams join iterator bug using LUBM data. ---