<commit_before>package com.twitter.scalding

// import com.twitter.pluck.config.DBConfig
// import com.twitter.pluck.config.ConnectionSpec

import cascading.jdbc.JDBCScheme
import cascading.jdbc.JDBCTap
import cascading.jdbc.TableDesc
import cascading.flow.FlowProcess
import cascading.flow.hadoop.HadoopFlowProcess
import cascading.scheme.Scheme
import cascading.scheme.local.TextDelimited
import cascading.tap.Tap
import cascading.tuple.Fields

/**
 * Extend this source to let scalding read from or write to a database.
 * In order for this to work you need to specify the db name as well as the table name, and column definitions.
 * If you write to a DB, the fields in the final pipe have to correspond to the column names in the DB table.
 *
 * @author <NAME>
 * @author <NAME>
 * @AUTHOR <NAME>
 */
abstract class JDBCSource extends Source {

  // Override the following three vals when you extend this class
  val dbName : String
  val tableName : String
  val columns : Iterable[ColumnDefinition]

  // Must be a subset of column names.
  // If updateBy column names are given, a SQL UPDATE statement will be generated
  // if the values in those columns for the given Tuple are all not {@code null}.
  // Otherwise an INSERT statement will be generated.
  val updateBy : Iterable[String] = Nil

  // The body of a WHERE clause. If present will filter the full table by this condition.
  val filterCondition: Option[String] = None<commit_msg>Reorder imports.<commit_after>package com.twitter.scalding

// import com.twitter.pluck.config.DBConfig
// import com.twitter.pluck.config.ConnectionSpec

import cascading.jdbc.JDBCScheme
import cascading.jdbc.JDBCTap
import cascading.jdbc.TableDesc
import cascading.scheme.Scheme
import cascading.tap.Tap
import cascading.tuple.Fields

/**
 * Extend this source to let scalding read from or write to a database.
 * In order for this to work you need to specify the db name as well as the table name, and column definitions.
 * If you write to a DB, the fields in the final pipe have to correspond to the column names in the DB table.
 *
 * @author <NAME>
 * @author <NAME>
 * @author <NAME>
 */
abstract class JDBCSource extends Source {

  // Override the following three vals when you extend this class
  val dbName : String
  val tableName : String
  val columns : Iterable[ColumnDefinition]

  // Must be a subset of column names.
  // If updateBy column names are given, a SQL UPDATE statement will be generated
  // if the values in those columns for the given Tuple are all not {@code null}.
  // Otherwise an INSERT statement will be generated.
  val updateBy : Iterable[String] = Nil

  // The body of a WHERE clause. If present will filter the full table by this condition.
  val filterCondition: Option[String] = None
{'fraction_non_alphanumeric': 0.06798561151079137, 'fraction_numerical': 0.0, 'mean_word_length': 3.836521739130435, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4333197', 'n_tokens_mistral': 799, 'n_tokens_neox': 748, 'n_words': 350}