Skip to content

Commit

Permalink
Remove lzo from tests, remove it from Vertica & Parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
HubertTatar committed Aug 22, 2023
1 parent 88a979d commit 111f135
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ object Compression {
override def fileExtension: Option[String] = Some("bz2")
}

case object LZOP extends Compression {
override def fileExtension: Option[String] = Some("lzo")
}

case object SNAPPY extends Compression {
override def fileExtension: Option[String] = Some("snappy")
}
Expand All @@ -55,7 +51,6 @@ object Compression {
case "zstd" => Some(Compression.ZSTD)
case "gzip" => Some(Compression.GZIP)
case "bzip" => Some(Compression.BZIP)
case "lzop" => Some(Compression.LZOP)
case "snappy" => Some(Compression.SNAPPY)
case "lz4" => Some(Compression.LZ4)
case _ => None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TimePartitioningFilePathFormatterTest extends AnyFunSpec with Matchers wit

it("should format filenames for files with a single record range") {
val formatter =
new TimePartitioningFilePathFormatter[LocalDate](Some("'dt='yyyyMMdd"), Compression.LZOP.fileExtension)
new TimePartitioningFilePathFormatter[LocalDate](Some("'dt='yyyyMMdd"), Compression.LZ4.fileExtension)
val ranges =
StreamRange(
"test-topic",
Expand All @@ -62,14 +62,14 @@ class TimePartitioningFilePathFormatterTest extends AnyFunSpec with Matchers wit
val formatted = formatter.formatPath(LocalDate.parse("2019-04-10"), Seq(ranges))

formatted should startWith("dt=20190410")
formatted should endWith(".lzo")
formatted should endWith(".lz4")

noException should be thrownBy UUID.fromString(formatted.substring(12, formatted.length - 4))
}

it("should format filenames for files with multiple record ranges") {
val formatter =
new TimePartitioningFilePathFormatter[LocalDate](Some("'dt='yyyyMMdd"), Compression.LZOP.fileExtension)
new TimePartitioningFilePathFormatter[LocalDate](Some("'dt='yyyyMMdd"), Compression.LZ4.fileExtension)
val ranges = Seq(
StreamRange(
"test-topic",
Expand All @@ -88,19 +88,19 @@ class TimePartitioningFilePathFormatterTest extends AnyFunSpec with Matchers wit
val formatted = formatter.formatPath(LocalDate.parse("2019-04-10"), ranges)

formatted should startWith("dt=20190410")
formatted should endWith(".lzo")
formatted should endWith(".lz4")

noException should be thrownBy UUID.fromString(formatted.substring(12, formatted.length - 4))
}

it("should format filenames correctly for arbitrary ranges") {
val formatter =
new TimePartitioningFilePathFormatter[LocalDate](Some("'dt='yyyyMMdd"), Compression.LZOP.fileExtension)
new TimePartitioningFilePathFormatter[LocalDate](Some("'dt='yyyyMMdd"), Compression.LZ4.fileExtension)
forAll { batches: Seq[StreamRange] =>
val formatted = formatter.formatPath(LocalDate.parse("2019-04-10"), batches)

formatted should startWith("dt=")
formatted should endWith(".lzo")
formatted should endWith(".lz4")

noException should be thrownBy formatted.substring(3, 11).toLong
noException should be thrownBy UUID.fromString(formatted.substring(12, formatted.length - 4))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ case class ParquetConfig(
case Compression.NONE => CompressionCodecName.UNCOMPRESSED
case Compression.ZSTD => CompressionCodecName.ZSTD
case Compression.GZIP => CompressionCodecName.GZIP
case Compression.LZOP => CompressionCodecName.LZO
case Compression.SNAPPY => CompressionCodecName.SNAPPY
case Compression.LZ4 => CompressionCodecName.LZ4
case _ => throw new UnsupportedOperationException(s"Compression '$compression' is unsupported in parquet")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ trait VerticaFileBuilder[-R] extends FileBuilder[R] {
case Compression.ZSTD => "ZSTD"
case Compression.GZIP => "GZIP"
case Compression.BZIP => "BZIP"
case Compression.LZOP => "LZO"
case _ => throw new UnsupportedOperationException(s"Compression $compression is not supported in Vertica")
}

Expand Down

0 comments on commit 111f135

Please sign in to comment.