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

Dataframes will now replaceOne with upsert if they contain an _id. #25

Closed
wants to merge 1 commit into from

Conversation

rozza
Copy link
Owner

@rozza rozza commented Aug 26, 2016

SPARK-66 SPARK-74

def save(dataFrame: DataFrame, writeConfig: WriteConfig): Unit = {
val mongoConnector = MongoConnector(writeConfig.asOptions)
val documentRdd: RDD[BsonDocument] = dataFrame.rdd.map(row => rowToDocument(row))
dataFrame.schema.fields.exists(_.name == "_id") match {

Choose a reason for hiding this comment

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

wouldn't if/else be simpler?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good point 👍

@evanchooly
Copy link

+1

@rozza rozza closed this Sep 1, 2016
@rozza
Copy link
Owner Author

rozza commented Sep 1, 2016

Rebased and merged

@rozza rozza deleted the s66 branch September 1, 2016 11:41
@FS1360472174
Copy link

why not support rdd

@sekys
Copy link

sekys commented Jan 3, 2019

please support RDD ...

@rozza
Copy link
Owner Author

rozza commented Jan 7, 2019

please support RDD ...

Please add a ticket to https://jira.mongodb.org/browse/SPARK - the reason there is no current RDD support is due to RDD's containing any serializable type, that could be converted to BSON by the codec registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants