Skip to content

Can't use id-based urls with TOP and Partitioned Collection #68

@helloitszak

Description

@helloitszak

Hello Everyone,
I am trying to use the newer style id-based resource links with TOP in the query and a partitioned collection.

Here's the line that fails:

List<Document> documents =
        client.queryDocuments("dbs/foo/colls/test",
                              "SELECT TOP 10 * FROM c", options)
              .getQueryIterable().toList();

If the string in queryDocuments is a selfLink uri or the collection is not partitioned, the above code works fine.

Here's the full exception.

Connected to the target VM, address: '127.0.0.1:56839', transport: 'socket'
Feb 20, 2017 7:29:26 PM com.microsoft.azure.documentdb.internal.ServiceJNIWrapper initializeServiceJni
WARNING: 'Mac OS X' with 'x86_64' system is not compatible with native library. JNI not loaded.
Exception in thread "main" java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: Server could not parse the Url., StatusCode: NotFound
	at com.microsoft.azure.documentdb.internal.routing.PartitionKeyRangeCache.getOverlappingRanges(PartitionKeyRangeCache.java:34)
	at com.microsoft.azure.documentdb.internal.routing.RoutingMapProviderHelper.getOverlappingRanges(RoutingMapProviderHelper.java:58)
	at com.microsoft.azure.documentdb.internal.query.AbstractQueryExecutionContext.getTargetPartitionKeyRanges(AbstractQueryExecutionContext.java:71)
	at com.microsoft.azure.documentdb.internal.query.ParallelQueryExecutionContext.<init>(ParallelQueryExecutionContext.java:55)
	at com.microsoft.azure.documentdb.internal.query.PipelinedQueryExecutionContext.<init>(PipelinedQueryExecutionContext.java:14)
	at com.microsoft.azure.documentdb.internal.query.ProxyQueryExecutionContext.<init>(ProxyQueryExecutionContext.java:83)
	at com.microsoft.azure.documentdb.internal.query.QueryExecutionContextFactory.createQueryExecutionContext(QueryExecutionContextFactory.java:20)
	at com.microsoft.azure.documentdb.QueryIterable.createQueryExecutionContext(QueryIterable.java:68)
	at com.microsoft.azure.documentdb.QueryIterable.reset(QueryIterable.java:113)
	at com.microsoft.azure.documentdb.QueryIterable.<init>(QueryIterable.java:55)
	at com.microsoft.azure.documentdb.DocumentClient.queryDocuments(DocumentClient.java:969)
	at com.microsoft.azure.documentdb.DocumentClient.queryDocuments(DocumentClient.java:929)
	at com.microsoft.azure.documentdb.DocumentClient.queryDocuments(DocumentClient.java:908)
	at Main.main(Main.java:28)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: Server could not parse the Url., StatusCode: NotFound
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at com.microsoft.azure.documentdb.internal.routing.PartitionKeyRangeCache.getOverlappingRanges(PartitionKeyRangeCache.java:32)
	... 13 more
Caused by: java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: Server could not parse the Url., StatusCode: NotFound
	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:53)
	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:10)
	at com.microsoft.azure.documentdb.internal.query.ProxyQueryExecutionContext.<init>(ProxyQueryExecutionContext.java:68)
	at com.microsoft.azure.documentdb.internal.query.QueryExecutionContextFactory.createQueryExecutionContext(QueryExecutionContextFactory.java:20)
	at com.microsoft.azure.documentdb.QueryIterable.createQueryExecutionContext(QueryIterable.java:68)
	at com.microsoft.azure.documentdb.QueryIterable.reset(QueryIterable.java:113)
	at com.microsoft.azure.documentdb.QueryIterable.<init>(QueryIterable.java:55)
	at com.microsoft.azure.documentdb.QueryIterable.<init>(QueryIterable.java:29)
	at com.microsoft.azure.documentdb.DocumentClient.readPartitionKeyRanges(DocumentClient.java:1430)
	at com.microsoft.azure.documentdb.DocumentQueryClient.readPartitionKeyRanges(DocumentQueryClient.java:28)
	at com.microsoft.azure.documentdb.internal.routing.PartitionKeyRangeCache.getRoutingMapForCollection(PartitionKeyRangeCache.java:72)
	at com.microsoft.azure.documentdb.internal.routing.PartitionKeyRangeCache.access$000(PartitionKeyRangeCache.java:12)
	at com.microsoft.azure.documentdb.internal.routing.PartitionKeyRangeCache$1.call(PartitionKeyRangeCache.java:30)
	at com.microsoft.azure.documentdb.internal.routing.PartitionKeyRangeCache$1.call(PartitionKeyRangeCache.java:27)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.microsoft.azure.documentdb.DocumentClientException: Server could not parse the Url., StatusCode: NotFound
	at com.microsoft.azure.documentdb.internal.ErrorUtils.maybeThrowException(ErrorUtils.java:68)
	at com.microsoft.azure.documentdb.internal.GatewayProxy.performGetRequest(GatewayProxy.java:224)
	at com.microsoft.azure.documentdb.internal.GatewayProxy.doReadFeed(GatewayProxy.java:104)
	at com.microsoft.azure.documentdb.internal.GatewayProxy.processMessage(GatewayProxy.java:313)
	at com.microsoft.azure.documentdb.DocumentClient$9.apply(DocumentClient.java:2631)
	at com.microsoft.azure.documentdb.internal.RetryUtility.executeDocumentClientRequest(RetryUtility.java:54)
	at com.microsoft.azure.documentdb.DocumentClient.doReadFeed(DocumentClient.java:2638)
	at com.microsoft.azure.documentdb.DocumentQueryClient.doReadFeed(DocumentQueryClient.java:32)
	at com.microsoft.azure.documentdb.internal.query.AbstractQueryExecutionContext.executeRequest(AbstractQueryExecutionContext.java:185)
	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.executeOnce(DefaultQueryExecutionContext.java:78)
	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.fillBuffer(DefaultQueryExecutionContext.java:66)
	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:51)
	... 17 more

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions