Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ThisBuild / scalaVersion := "3.3.7"

val fs2DataVersion = "1.8.1"
val http4sVersion = "0.23.33"
val latisVersion = "792d62ed"
val latisVersion = "8880e46d"
val latisHapiVersion = "d70da0a5"

lazy val root = (project in file("."))
Expand Down
5 changes: 5 additions & 0 deletions src/main/scala/latis/ops/ConvertHapiTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ConvertHapiTypes extends MapOperation {

private def convertValue(data: Data): Data = data match {
case v: ShortValue => IntValue(v.value.toInt)
case v: LongValue => IntValue(v.value.toInt) //TODO: risk of overflow
case v: FloatValue => DoubleValue(v.value.toDouble)
case _ => data //no-op, shouldn't get here due to catalog filter
}
Expand All @@ -45,6 +46,10 @@ class ConvertHapiTypes extends MapOperation {
Scalar.fromMetadata(
scalar.metadata + ("type" -> "int")
).fold(throw _, identity) //should not fail
case LongValueType =>
Scalar.fromMetadata(
scalar.metadata + ("type" -> "int")
).fold(throw _, identity) //should not fail
case _ => scalar //no-op, shouldn't get here due to catalog filter
}
}
1 change: 1 addition & 0 deletions src/main/scala/latis/service/hapi/HapiService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class HapiService(catalog: Catalog) extends ServiceInterface(catalog, OperationR
case "string" => md.getProperty("size").isDefined
case "double" => true
case "int" => true
case "long" => true
case "float" => true //may be converted to double by ConvertHapiTypes
case "short" => true //may be converted to int by ConvertHapiTypes
case _ => false
Expand Down