Skip to content

SB-21245 scala script for migrating self-declared user details to con…#312

Open
Hari-stackroute wants to merge 7 commits intoSunbird-Ed:release-3.6.0from
Hari-stackroute:SB-21245
Open

SB-21245 scala script for migrating self-declared user details to con…#312
Hari-stackroute wants to merge 7 commits intoSunbird-Ed:release-3.6.0from
Hari-stackroute:SB-21245

Conversation

@Hari-stackroute
Copy link
Copy Markdown
Contributor

…sent table


def migrateSelfDeclaredToConsent()(implicit spark: SparkSession): Unit = {
var userConsentdDF = spark.read.format("org.apache.spark.sql.cassandra").option("keyspace", "sunbird").option("table", "user_consent").load().persist(StorageLevel.MEMORY_ONLY)
userConsentdDF = userConsentdDF.where(col("object_type").isin("global", "Organisation"))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do a persist here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@SanthoshVasabhaktula : done the change

var userConsentdDF = spark.read.format("org.apache.spark.sql.cassandra").option("keyspace", "sunbird").option("table", "user_consent").load().persist(StorageLevel.MEMORY_ONLY)
userConsentdDF = userConsentdDF.where(col("object_type").isin("global", "Organisation"))
println("user_consent data Count : " + userConsentdDF.count())
var userDeclaredDF = spark.read.format("org.apache.spark.sql.cassandra").option("keyspace", "sunbird").option("table", "user_declarations").load().persist(StorageLevel.MEMORY_ONLY)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dont use var

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@SanthoshVasabhaktula : setted all DF's as val instead on var's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants