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

[WIP]Try to unblock payments backfill #881

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yuli-han
Copy link
Collaborator

Summary

Why / Goal

Test Plan

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested

Checklist

  • Documentation update

Reviewers

repartitionAndWriteInternal(df, tableName, saveMode, stats, sortByCols)
}.get
//repartitionAndWriteInternal(df, tableName, saveMode, stats, sortByCols)
}.get*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideas for incorporating this change long term:

if (df.sparkSession.conf.getOption(SparkConstants.ChrononEnableRowCountBasedRepartitin).exists("true")) {
      wrapWithCache(s"repartition & write to $tableName", df) {
        logger.info(s"Repartitioning before writing...")
        repartitionAndWriteInternal(df, tableName, saveMode, stats, sortByCols)
      }.get  
    } else {
      val shuffleParallelism = df.sparkSession.conf
        .getOption(SparkConstants.ChrononOutputParallelismOverride)
        .map(_.toInt)
        .flatMap(value => if (value > 0) Some(value) else None)
      
      val dfRepartitioned = if (shuffleParallelism.isDefined) {
        df.repartition(shuffleParallelism.get)
      } else {
        df
      }
      dfRepartitioned
        .write
        .mode(saveMode)
        .insertInto(tableName)
    }

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