-
Notifications
You must be signed in to change notification settings - Fork 36
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
SB-21245 scala script for migrating self-declared user details to con… #312
base: release-3.6.0
Are you sure you want to change the base?
SB-21245 scala script for migrating self-declared user details to con… #312
Conversation
|
||
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")) |
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.
Do a persist here
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.
@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) |
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.
Dont use var
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.
@SanthoshVasabhaktula : setted all DF's as val instead on var's
…sent table