
## Clean up DB.raw

# ========================================================================== #

  NAsynonyms <- c("NULL", "")
  NAsynonymClean_ (DB.raw, NAsynonyms=NAsynonyms, verbose=TRUE)
  rm(NAsynonyms)

# ========================================================================== #

  if (!is.character(DB.raw[["user_gender"]]))
    DB.raw[, user_gender := as.character(user_gender)]

  DB.raw[grep("\\b(male)\\b",   user_gender, ignore.case=TRUE), user_gender := "Male"]
  DB.raw[grep("\\b(female)\\b", user_gender, ignore.case=TRUE), user_gender := "Female"]

# ========================================================================== #

  ## Note to self. idCols should actually serve an "id-like" purpose, such as UPC
  ##     If I would never use the column as an argument in "by=", then it should
  ##     not be an idCol (instead use character, etc) 

  # USE trackid, NOT isrc  (some isrcs have more than one track associated to them)
  idCols <- c("userid", "trackid", "upc", "artist")  # this second row, possible character or factors

  stringCols <- c("isrc", "trackname", "albumname", "user_zip")

  factorCols <- c("product", "user_gender", "user_country")

  integerCols <- c("user_birthyear")

  logicalCols <- c("mobile")

  posixCols <- c("download_datetime")
  tz.posix <- "UTC"

  fixColTypes_(DB.raw, idcol=idCols, character=stringCols, integer=integerCols, factor=factorCols, logical=logicalCols, posix=posixCols, tz.posix=tz.posix, verbose=verbose)

# ========================================================================== #

  ## SET KEY
  s.t(setkey(DB.raw, upc), title="setting key")


# ========================================================================== #


  ## ------------------------------ ##
  ##      SAVE THE DATA             ##
  ## ------------------------------ ##
  # SHALLOW Copy
  DB.raw.RAW <- DB.raw
  
  f.ind <- paste0("DB_raw_RAW", "_", qry_timestamp)
  fileBackUps[[ f.ind ]] <-
  
       jesus(DB.raw.RAW, dir=dataDir, sub=FALSE, stampFile=TRUE, stampDir=FALSE, summary=FALSE, verbose=FALSE)
  
  rm(DB.raw.RAW)
  invisible(reproduce((fileBackUps[[f.ind]]), name="file.DB.raw.RAW", clipboard=FALSE, showSample=FALSE))

  # Clean up garbage before saving image
  gcQuietly()

  if (saveAfterEachDataIngest)
    saveImageTo(verbose=FALSE)
  ## ------------------------------ ##
