<commit_before>package com.socrata.datacoordinator
package truth.loader
package sql
package perf

import scala.runtime.ScalaRunTime
import com.socrata.datacoordinator.id.RowId

sealed abstract class PerfValue {
  def sqlize: String
}
case class PVId(value: RowId) extends PerfValue {
  def sqlize = value.toString
}
case class PVNumber(value: BigDecimal) extends PerfValue {
  def sqlize = value.toString

  @volatile private var hashComputed = false
  private var hash: Int = _
  override def hashCode = {
    if(!hashComputed) { hash = ScalaRunTime._hashCode(this); hashComputed = true }
    hash
  }
}
case class PVText(value: String) extends PerfValue {
  def sqlize = "'" + value.replaceAllLiterally("'", "''") + "'"
}
case object PVNull extends PerfValue {
  def sqlize = "NULL"
}<commit_msg>Perftest: fix latent bug in sqlizing PVId values<commit_after>package com.socrata.datacoordinator
package truth.loader
package sql
package perf

import scala.runtime.ScalaRunTime
import com.socrata.datacoordinator.id.RowId

sealed abstract class PerfValue {
  def sqlize: String
}
case class PVId(value: RowId) extends PerfValue {
  def sqlize = value.underlying.toString
}
case class PVNumber(value: BigDecimal) extends PerfValue {
  def sqlize = value.toString

  @volatile private var hashComputed = false
  private var hash: Int = _
  override def hashCode = {
    if(!hashComputed) { hash = ScalaRunTime._hashCode(this); hashComputed = true }
    hash
  }
}
case class PVText(value: String) extends PerfValue {
  def sqlize = "'" + value.replaceAllLiterally("'", "''") + "'"
}
case object PVNull extends PerfValue {
  def sqlize = "NULL"
}
{'fraction_non_alphanumeric': 0.09500609013398295, 'fraction_numerical': 0.0, 'mean_word_length': 4.607508532423208, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1895527', 'n_tokens_mistral': 540, 'n_tokens_neox': 524, 'n_words': 151}