Skip to content
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

basic support for user provided schema in the query path #18031

Conversation

moderakh
Copy link
Contributor

@moderakh moderakh commented Dec 9, 2020

Cosmos Spark3 DataSourceV2 basic support for user provided schema in the query path

  • basic support for user provided schema in the query path
  • integration e2e test for query with user provided schema see SparkE2EQuerySpec for e2e test.

sample usage:

val customSchema = StructType(Array(
  StructField("id", StringType),
  StructField("name", StringType),
  StructField("type", StringType),
  StructField("age", IntegerType),
  StructField("isAlive", BooleanType)
))

val df = spark.read.schema(customSchema).format("cosmos.items").options(cfg).load()

For now we only support user provided schema in the query path.
TODO:

  • schema inference support

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@moderakh moderakh merged commit 4a5459a into Azure:feature/cosmos/spark30 Dec 9, 2020
@moderakh moderakh deleted the users/moderakh/user-provided-schema-on-read-path branch December 9, 2020 17:58
@moderakh moderakh linked an issue Dec 18, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmos:spark3 Cosmos DB Spark3 OLTP Connector Cosmos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

basic support for user provided schema in the query path
2 participants