This repository was archived by the owner on Mar 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 121
Added sbt-based project for Scala samples #110
Open
jcjimenez
wants to merge
4
commits into
Azure:master
Choose a base branch
from
jcjimenez:scala_samples
base: master
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.
Conversation
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
jcjimenez
commented
Aug 21, 2017
"com.fasterxml.jackson.core" % "jackson-core" % "2.8.3", | ||
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.3", | ||
"com.fasterxml.jackson.module" % "jackson-module-paranamer" % "2.8.9", | ||
"com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that before adding these (and the corresponding exclusion above), I was getting an exception citing a conflict in the minor version(s) of jackson modules. I'm happy to file an issue as well as to roll this change into #105
jcjimenez
commented
Aug 21, 2017
CosmosDBConfig.Masterkey -> sys.env("COSMOS_DB_MASTER_KEY"), | ||
CosmosDBConfig.Database -> "samples", | ||
CosmosDBConfig.Collection -> "airports", | ||
CosmosDBConfig.ConnectionMode -> "Gateway" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that omitting the ConnectionMode
entry resulted in an exception like the following:
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:69)
at com.microsoft.azure.documentdb.internal.GatewayProxy.performGetRequest(GatewayProxy.java:240)
at com.microsoft.azure.documentdb.internal.GatewayProxy.doReadFeed(GatewayProxy.java:109)
at com.microsoft.azure.documentdb.internal.GatewayProxy.processMessage(GatewayProxy.java:338)
at com.microsoft.azure.documentdb.DocumentClient$9.apply(DocumentClient.java:2996)
at com.microsoft.azure.documentdb.internal.RetryUtility.executeDocumentClientRequest(RetryUtility.java:58)
at com.microsoft.azure.documentdb.DocumentClient.doReadFeed(DocumentClient.java:3006)
at com.microsoft.azure.documentdb.DocumentQueryClientInternal.doReadFeed(DocumentQueryClientInternal.java:36)
at com.microsoft.azure.documentdb.internal.query.AbstractQueryExecutionContext.executeRequest(AbstractQueryExecutionContext.java:215)
at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.executeOnce(DefaultQueryExecutionContext.java:131)
at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.fillBuffer(DefaultQueryExecutionContext.java:101)
at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:84)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I ran into a few issues when trying to get the Cosmos DB connector running in Scala, so this samples project aims to save folks time when starting out. The main issues where:
Adding the
azure-cosmosdb-spark_2.2.0_2.11
dependency to my project required tweaking exclusions.It looks like omitting
CosmosDBConfig.ConnectionMode -> "Gateway"
from the config map results in a failure (Something likeServer could not parse the Url., StatusCode: NotFound
).