-
Notifications
You must be signed in to change notification settings - Fork 121
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
Added sbt-based project for Scala samples #110
base: master
Are you sure you want to change the base?
Conversation
"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
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)
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
).