Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adeet1 committed Mar 20, 2024
1 parent 237db93 commit b3a4694
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ class ParquetFunctionFactory extends TransformerFunctionFactory {
import SimpleFeatureParquetSchemaV1.{GeometryColumnX, GeometryColumnY}

override def apply(args: Array[AnyRef]): AnyRef = {
val record = args(0).asInstanceOf[GenericRecord]
val collection = path.eval(record)
val result = collection.collect {
path.eval(args(0).asInstanceOf[GenericRecord]).collect {
case r: GenericRecord => eval(r.get(GeometryColumnX).asInstanceOf[U], r.get(GeometryColumnY).asInstanceOf[U])
case r: Array[Byte] => eval(r)
}
result.orNull
}.orNull
}

protected def getPath(args: List[Expression]): AvroPath = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ class ParquetConverterTest extends Specification {
WithClose(converter.process(file.openStream(), ec))(_.toList)
}

ParquetFileSystemStorage.validateParquetFile(new Path(path))

res must haveLength(3)
res.map(_.getID) mustEqual Seq("1", "2", "3")
res.map(_.getAttribute("name")) mustEqual Seq("first", null, "third")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ object SimpleFeatureReadSupport {

private def geometryV0V1(binding: ObjectType, i: Int, callback: Settable): Converter = {
binding match {
case ObjectType.POINT => new PointConverter(i, callback)
case ObjectType.LINESTRING => new LineStringConverter(i, callback)
case ObjectType.POLYGON => new PolygonConverter(i, callback)
case ObjectType.MULTIPOINT => new MultiPointConverter(i, callback)
case ObjectType.POINT => new PointConverter(i, callback)
case ObjectType.LINESTRING => new LineStringConverter(i, callback)
case ObjectType.POLYGON => new PolygonConverter(i, callback)
case ObjectType.MULTIPOINT => new MultiPointConverter(i, callback)
case ObjectType.MULTILINESTRING => new MultiLineStringConverter(i, callback)
case ObjectType.MULTIPOLYGON => new MultiPolygonConverter(i, callback)
case ObjectType.GEOMETRY => new GeometryWkbConverter(i, callback)
case ObjectType.MULTIPOLYGON => new MultiPolygonConverter(i, callback)
case ObjectType.GEOMETRY => new GeometryWkbConverter(i, callback)
case _ => throw new IllegalArgumentException(s"Can't deserialize field of type $binding")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ class ParquetReadWriteTest extends Specification with AllExpectations with LazyL
}

"write parquet files" >> {
import org.locationtech.geomesa.fs.storage.common.observer

val writer = SimpleFeatureParquetWriter.builder(new Path(f.toUri), sftConf).build()

WithClose(writer) { writer =>
features.foreach(writer.write)
}
Expand Down

0 comments on commit b3a4694

Please sign in to comment.