Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sealed abstract class SoQLFunctions
object SoQLFunctions {
private val log = org.slf4j.LoggerFactory.getLogger(classOf[SoQLFunctions])

import SoQLTypeClasses.{Ordered, Equatable, NumLike, RealNumLike, GeospatialLike, TimestampLike, PointLike, LineLike, PolygonLike}
import SoQLTypeClasses.{Ordered, Equatable, NumLike, RealNumLike, GeospatialLike, TimestampLike, PointLike, LineLike, PolygonLike, Stringable}
private val AllTypes = CovariantSet.from(SoQLType.typesByName.values.toSet)

val NoDocs = "No documentation available"
Expand Down Expand Up @@ -101,7 +101,7 @@ object SoQLFunctions {
NoDocs
).hidden // Required by the old sqlizer (not a real function, requires a string literal); not necessary in the new-sqlizer

val Concat = f("||", SpecialFunctions.Operator("||"), Map.empty, Seq(VariableType("a"), VariableType("b")), Seq.empty, FixedType(SoQLText))(
val Concat = f("||", SpecialFunctions.Operator("||"), Map("a" -> Stringable, "b" -> Stringable), Seq(VariableType("a"), VariableType("b")), Seq.empty, FixedType(SoQLText))(
"Concatenate two strings", Example("Concatenate two strings", "'first' || 'second' as concat", ""), Example("Concatenate with columns", "col_a || 'second' as concat", "")
)
val Gte = f(">=", SpecialFunctions.Operator(">="), Map("a" -> Ordered), Seq(VariableType("a"), VariableType("a")), Seq.empty, FixedType(SoQLBoolean))(
Expand Down Expand Up @@ -896,13 +896,6 @@ object SoQLFunctions {
NoDocs
).hidden // required by the old-sqlizer (not a real function, requires a string literal); not necessary in the new

val RowIdentifierToText = mf("rid to text", SpecialFunctions.Cast(SoQLText.name), Seq(SoQLID), Seq.empty, SoQLText)(
NoDocs
).hidden
val RowVersionToText = mf("rowver to text", SpecialFunctions.Cast(SoQLText.name), Seq(SoQLVersion), Seq.empty, SoQLText)(
NoDocs
).hidden

val Iif = f("iif", FunctionName("iif"), Map.empty,
Seq(FixedType(SoQLBoolean), VariableType("a"), VariableType("a")),
Seq.empty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ object SoQLTypeClasses {
val NumLike = CovariantSet[SoQLType](SoQLNumber, SoQLDouble)
val RealNumLike = CovariantSet[SoQLType](SoQLNumber, SoQLDouble)
val TimestampLike = CovariantSet[SoQLType](SoQLFixedTimestamp, SoQLFloatingTimestamp)

val Stringable = CovariantSet[SoQLType](SoQLType.allTypes.toSeq.filter {
case SoQLID | SoQLVersion => false
case _ => true
} : _*)
}