-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Adding readManyByPartitionKey API #48801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FabianMeiswinkel
wants to merge
89
commits into
main
Choose a base branch
from
users/fabianm/readManyByPK
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
9770833
Adding readManyByPartitionKey API
FabianMeiswinkel ac287bc
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel 9a5b3e9
Update sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmo…
FabianMeiswinkel a8720c3
Update sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmo…
FabianMeiswinkel d499da7
Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/impleme…
FabianMeiswinkel c3c542a
Update sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/impleme…
FabianMeiswinkel 4416354
´Fixing code review comments
FabianMeiswinkel 3ab3f0d
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel 588a755
Update CosmosAsyncContainer.java
FabianMeiswinkel 8c5cdb4
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel f548552
Update ReadManyByPartitionKeyTest.java
FabianMeiswinkel f68cf02
Fixing test issues
FabianMeiswinkel 8b6c4b1
Update CosmosAsyncContainer.java
FabianMeiswinkel 8ba7f4d
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 56b067a
Reacted to code review feedback
FabianMeiswinkel fa430e9
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel d9504c9
Fix build issues
FabianMeiswinkel 73151f0
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 681830e
Fixing changelog
FabianMeiswinkel 7f745e6
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 0b8905d
Addressing code review comments
FabianMeiswinkel 22abc78
Addressing code review feedback
FabianMeiswinkel 662b1a4
Update CosmosItemsDataSource.scala
FabianMeiswinkel c764de9
Update CosmosItemsDataSource.scala
FabianMeiswinkel e1e6f5a
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 080ce4a
Update RxDocumentClientImpl.java
FabianMeiswinkel 516bbf3
Merge branch 'users/fabianm/readManyByPK' of https://github.com/Azure…
FabianMeiswinkel b01f875
Fix readManyByPartitionKey retries
FabianMeiswinkel 7130d4a
Fix PK.None
FabianMeiswinkel 93957f3
Update ReadManyByPartitionKeyQueryHelper.java
FabianMeiswinkel 16dd1d6
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 9200f8f
Fix code review feedback
FabianMeiswinkel 4a3ea06
Merge branch 'users/fabianm/readManyByPK' of https://github.com/Azure…
FabianMeiswinkel e2aa124
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel c34341e
Merge branch 'users/fabianm/readManyByPK' of https://github.com/Azure…
FabianMeiswinkel c96b6f6
Reacting to code review feedback
FabianMeiswinkel e306fae
React to code review feedback
FabianMeiswinkel f34270d
Addressing code review comments
FabianMeiswinkel 55ddac3
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel f13de23
Fixing nested PK for readMany / readAllItems
FabianMeiswinkel b0d7337
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel ce8fca3
Fixed changelogs
FabianMeiswinkel 992ef1a
Disallow TOP for streamable queries in readManyByPartitionKey-API
FabianMeiswinkel 84af9c3
Fixing quote recognition in pk for readManyByPartitionKey API
FabianMeiswinkel b0b7349
Fixing confusing side effects when calling GetCurrentRow
FabianMeiswinkel 42a2fb8
Fixed code review comments
FabianMeiswinkel 89ac19e
Fixed code review comment
FabianMeiswinkel ea28c5d
Avoid getting pkPaths (pk-def) per row
FabianMeiswinkel 35e9d73
Update CosmosReadManyByPartitionKeyReader.scala
FabianMeiswinkel 78bbd15
Renamed readManyByPartitionKey to readManyByPartitionKeys
FabianMeiswinkel dd83125
Fixing code review comments
FabianMeiswinkel 2246e3f
added test
FabianMeiswinkel fdfa15f
Fixing continuation Token
FabianMeiswinkel 5da1906
Update RxDocumentClientImpl.java
FabianMeiswinkel 79d2487
Update readManyByPartitionKey-design.md
FabianMeiswinkel f12582f
Fixed code review comments
FabianMeiswinkel 0d3280a
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 5b44e34
Changed the continuation token to not carry partitionScopes anymore
FabianMeiswinkel da578f6
Update cspell.yaml
FabianMeiswinkel f393c3f
Fixing test failure
FabianMeiswinkel 280bc87
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel d4722c2
Fixed test issues
FabianMeiswinkel 26df2ab
Update FeedResponse.java
FabianMeiswinkel a45aabb
Update FeedResponse.java
FabianMeiswinkel 7299a2c
Fixes test issues
FabianMeiswinkel dc00653
Fixed null handinlgin in ReadManyByParittionKeyToken JsonCreator
FabianMeiswinkel c47f9a6
Update CosmosAsyncContainer.java
FabianMeiswinkel 1f2f14b
Renamed CosmosReadManyPartitionKeyRequestOptions to CosmosReadManyPar…
FabianMeiswinkel 9c75a32
Code review fixes
FabianMeiswinkel e8ea368
Fixed test issues
FabianMeiswinkel f3aa1da
updates to patch sparse checkout to account for spring and cosmos whi…
scbedd 2c404e6
Update eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1
scbedd 112cf71
Fixing code review comments
FabianMeiswinkel 348257a
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-java in…
FabianMeiswinkel bdc5a2d
Merge branch 'patch-sparse-checkout' of https://github.com/Azure/azur…
FabianMeiswinkel cbd8a93
Fixes code review comments
FabianMeiswinkel cf678fa
Fixed code review comments
FabianMeiswinkel 17cfe75
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel bbfa698
Added e2e test for resuming readManyByPartitionKeys with continuation…
FabianMeiswinkel 587cac6
Added and fixed tests
FabianMeiswinkel 6e1cf84
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 59f3d44
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 81a99f3
Update CosmosItemSerializerNoExceptionWrapping.scala
FabianMeiswinkel 2d8f2a0
Merge branch 'users/fabianm/readManyByPK' of https://github.com/Azure…
FabianMeiswinkel 5beab22
Update ReadManyByPartitionKeyContinuationToken.java
FabianMeiswinkel 853bd04
Update DocumentQueryExecutionContextFactory.java
FabianMeiswinkel 0fc0cc6
Merge branch 'main' into users/fabianm/readManyByPK
FabianMeiswinkel 53ad60d
Update FaultInjectionWithAvailabilityStrategyTestsBase.java
FabianMeiswinkel 970d209
Merge branch 'users/fabianm/readManyByPK' of https://github.com/Azure…
FabianMeiswinkel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosPartitionKeyHelper.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.cosmos.spark | ||
|
|
||
| import com.azure.cosmos.implementation.routing.PartitionKeyInternal | ||
| import com.azure.cosmos.implementation.{ImplementationBridgeHelpers, Utils} | ||
| import com.azure.cosmos.models.PartitionKey | ||
| import com.azure.cosmos.spark.diagnostics.BasicLoggingTrait | ||
|
|
||
| import java.util | ||
|
|
||
| // scalastyle:off underscore.import | ||
| import scala.collection.JavaConverters._ | ||
| // scalastyle:on underscore.import | ||
|
|
||
| private[spark] object CosmosPartitionKeyHelper extends BasicLoggingTrait { | ||
| // pattern will be recognized | ||
| // pk(partitionKeyValue) | ||
| // | ||
| // (?i) : The whole matching is case-insensitive | ||
| // pk[(](.*)[)]: partitionKey Value | ||
| private val cosmosPartitionKeyStringRegx = """(?i)pk[(](.*)[)]""".r | ||
| private val objectMapper = Utils.getSimpleObjectMapper | ||
|
|
||
| def getCosmosPartitionKeyValueString(partitionKeyValue: List[Object]): String = { | ||
| s"pk(${objectMapper.writeValueAsString(partitionKeyValue.asJava)})" | ||
| } | ||
|
|
||
| def tryParsePartitionKey(cosmosPartitionKeyString: String): Option[PartitionKey] = { | ||
| cosmosPartitionKeyString match { | ||
|
FabianMeiswinkel marked this conversation as resolved.
|
||
| case cosmosPartitionKeyStringRegx(pkValue) => | ||
| scala.util.Try(Utils.parse(pkValue, classOf[Object])).toOption.flatMap { | ||
| case arrayList: util.ArrayList[Object @unchecked] => | ||
| Some( | ||
| ImplementationBridgeHelpers | ||
| .PartitionKeyHelper | ||
| .getPartitionKeyAccessor | ||
| .toPartitionKey(PartitionKeyInternal.fromObjectArray(arrayList.toArray, false))) | ||
| case other => Some(new PartitionKey(other)) | ||
| } | ||
| case _ => None | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.