- java.lang.Object
-
- com.pervasive.datarush.functions.Conversions
-
public class Conversions extends Object
Provides implementations of common type conversion functions. These functions are for conversions which would not normally be permitted by the token type system as they are either possibly "lossy" (such as type narrowing) or ambiguous (such as string formatting).- See Also:
ScalarValuedFunction,DeriveFields
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScalarValuedFunctionasBoolean(ScalarValuedFunction expr, int truth, int falsity)Convert an int typed field into a boolean type.static ScalarValuedFunctionasBoolean(String field)Convert an int typed field into a boolean type.static ScalarValuedFunctionasBoolean(String field, int truth, int falsity)Convert an int typed field into a boolean type.static ScalarValuedFunctionasDate(ScalarValuedFunction expr)Convert a timestamp expression result into a date field.static ScalarValuedFunctionasDate(String field)Convert a timestamp typed field into a date field.static ScalarValuedFunctionasDouble(ScalarValuedFunction expr)Convert a numeric typed expression into a double type.static ScalarValuedFunctionasDouble(String field)Convert a numeric typed field into a double type.static ScalarValuedFunctionasFloat(ScalarValuedFunction expr)Convert a numeric typed expression into a float type.static ScalarValuedFunctionasFloat(String field)Convert a numeric typed field into a float type.static ScalarValuedFunctionasInt(ScalarValuedFunction expr)Convert a numeric typed expression into an integer type.static ScalarValuedFunctionasInt(String field)Convert a numeric typed field into an integer type.static ScalarValuedFunctionasLong(ScalarValuedFunction expr)Convert a numeric typed expression into a long type.static ScalarValuedFunctionasLong(String field)Convert a numeric typed field into a long type.static ScalarValuedFunctionasMoney(ScalarValuedFunction expr)Convert a numeric typed expression into a money type.static ScalarValuedFunctionasMoney(String field)Convert a numeric typed field into a money type.static ScalarValuedFunctionasNumeric(ScalarValuedFunction expr)Convert a numeric typed expression into a numeric type.static ScalarValuedFunctionasNumeric(String field)Convert a numeric typed field into a numeric type.static ScalarValuedFunctionasTime(ScalarValuedFunction expr)Convert a timestamp expression result into a time field.static ScalarValuedFunctionasTime(String field)Convert a timestamp typed field into a time field.static ScalarValuedFunctiontoBinary(ScalarValuedFunction expr)Convert a string typed expression into a binary type.static ScalarValuedFunctiontoBinary(String fieldName)Convert a string typed field into a binary type.static ScalarValuedFunctiontoBoolean(ScalarValuedFunction expr, TruthValues mapping)Convert a string typed expression into a boolean type.static ScalarValuedFunctiontoBoolean(ScalarValuedFunction expr, String truth, String falsity)Convert a string typed expression into a boolean type.static ScalarValuedFunctiontoBoolean(String field, TruthValues mapping)Convert a string typed field into a boolean type.static ScalarValuedFunctiontoBoolean(String field, String truth, String falsity)Convert a string typed field into a boolean type.static ScalarValuedFunctiontoChar(ScalarValuedFunction expr)Convert a string typed expression into a char type.static ScalarValuedFunctiontoChar(String fieldName)Convert a string typed field into a char type.static ScalarValuedFunctiontoDate(ScalarValuedFunction expr)Convert a string typed expression into a date type.static ScalarValuedFunctiontoDate(ScalarValuedFunction expr, DateTimeFormatting format)Convert a string typed expression into a date type using the given format.static ScalarValuedFunctiontoDate(String field)Convert a string typed field into a date type.static ScalarValuedFunctiontoDate(String field, DateTimeFormatting format)Convert a string typed field into a date type using the given format.static ScalarValuedFunctiontoDate(String field, String format)Convert a string typed field into a date type using the given format.static ScalarValuedFunctiontoDouble(ScalarValuedFunction expr)Convert a string typed expression into a double type.static ScalarValuedFunctiontoDouble(ScalarValuedFunction expr, NumberFormat format)Convert a string typed expression into a double type using the given format.static ScalarValuedFunctiontoDouble(String field)Convert a string typed field into a double type.static ScalarValuedFunctiontoDouble(String field, String format)Convert a string typed field into a double type using the given format.static ScalarValuedFunctiontoDouble(String field, NumberFormat format)Convert a string typed field into a double type using the given format.static ScalarValuedFunctiontoFloat(ScalarValuedFunction expr)Convert a string typed expression into a float type.static ScalarValuedFunctiontoFloat(ScalarValuedFunction expr, NumberFormat format)Convert a string typed expression into a float type using the given format.static ScalarValuedFunctiontoFloat(String field)Convert a string typed field into a float type.static ScalarValuedFunctiontoFloat(String field, String format)Convert a string typed field into a float type using the given format.static ScalarValuedFunctiontoFloat(String field, NumberFormat format)Convert a string typed field into a float type using the given format.static ScalarValuedFunctiontoInt(ScalarValuedFunction expr)Convert a string typed expression into a integer type.static ScalarValuedFunctiontoInt(ScalarValuedFunction expr, NumberFormat format)Convert a string typed expression into a integer type using the given format.static ScalarValuedFunctiontoInt(String field)Convert a string typed field into a integer type.static ScalarValuedFunctiontoInt(String field, String format)Convert a string typed field into a integer type using the given format.static ScalarValuedFunctiontoInt(String field, NumberFormat format)Convert a string typed field into a integer type using the given format.static ScalarValuedFunctiontoLong(ScalarValuedFunction expr)Convert a string typed expression into a long type.static ScalarValuedFunctiontoLong(ScalarValuedFunction expr, NumberFormat format)Convert a string typed expression into a long type using the given format.static ScalarValuedFunctiontoLong(String field)Convert a string typed field into a long type.static ScalarValuedFunctiontoLong(String field, String format)Convert a string typed field into a long type using the given format.static ScalarValuedFunctiontoLong(String field, NumberFormat format)Convert a string typed field into a long type using the given format.static ScalarValuedFunctiontoMoney(ScalarValuedFunction expr)Convert a string typed expression into a money type.static ScalarValuedFunctiontoMoney(ScalarValuedFunction expr, NumberFormat format)Convert a string typed expression into a money type using the given format.static ScalarValuedFunctiontoMoney(String field)Convert a string typed field into a money type.static ScalarValuedFunctiontoMoney(String field, String format)Convert a string typed field into a money type using the given format.static ScalarValuedFunctiontoMoney(String field, NumberFormat format)Convert a string typed field into a money type using the given format.static ScalarValuedFunctiontoNumeric(ScalarValuedFunction expr)Convert a string typed expression into a numeric type.static ScalarValuedFunctiontoNumeric(ScalarValuedFunction expr, NumberFormat format)Convert a string typed expression into a numeric type using the given format.static ScalarValuedFunctiontoNumeric(String field)Convert a string typed field into a numeric type.static ScalarValuedFunctiontoNumeric(String field, String format)Convert a string typed field into a numeric type using the given format.static ScalarValuedFunctiontoNumeric(String field, NumberFormat format)Convert a string typed field into a numeric type using the given format.static ScalarValuedFunctiontoString(ScalarValuedFunction expr)Convert the value of an expression into a string value.static ScalarValuedFunctiontoString(String field)Convert a scalar type field into a string value.static ScalarValuedFunctiontoText(ScalarValuedFunction expr, String format)Convert the value of an expression into text using the given format.static ScalarValuedFunctiontoText(ScalarValuedFunction expr, Format formatter)Convert the value of an expression into text using the given format.static ScalarValuedFunctiontoText(String field, String format)Convert a scalar type field into text using the given format.static ScalarValuedFunctiontoText(String field, Format formatter)Convert a scalar type field into text using the given format.static ScalarValuedFunctiontoTime(ScalarValuedFunction expr)Convert a string typed expression into a time type.static ScalarValuedFunctiontoTime(ScalarValuedFunction expr, DateTimeFormatting format)Convert a string typed expression into a time type using the given format.static ScalarValuedFunctiontoTime(String field)Convert a string typed field into a time type.static ScalarValuedFunctiontoTime(String field, DateTimeFormatting format)Convert a string typed field into a time type using the given format.static ScalarValuedFunctiontoTime(String field, String format)Convert a string typed field into a time type using the given format.static ScalarValuedFunctiontoTimestamp(ScalarValuedFunction expr)Convert a string typed expression into a timestamp type.static ScalarValuedFunctiontoTimestamp(ScalarValuedFunction expr, DateTimeFormatting format)Convert a string typed expression into a timestamp type using the given format.static ScalarValuedFunctiontoTimestamp(String field)Convert a string typed field into a timestamp type.static ScalarValuedFunctiontoTimestamp(String field, DateTimeFormatting format)Convert a string typed field into a timestamp type using the given format.static ScalarValuedFunctiontoTimestamp(String field, String format)Convert a string typed field into a timestamp type using the given format.
-
-
-
Method Detail
-
asBoolean
public static ScalarValuedFunction asBoolean(String field)
Convert an int typed field into a boolean type. Unmapped values will be set to null.- Parameters:
field- a field whose type is an int- Returns:
- the function that provides the conversion
-
asBoolean
public static ScalarValuedFunction asBoolean(String field, int truth, int falsity)
Convert an int typed field into a boolean type. Unmapped values will be set to null.- Parameters:
field- a field whose type is an inttruth- int representing the value of truefalsity- int representing the value of false- Returns:
- the function that provides the conversion
-
asBoolean
public static ScalarValuedFunction asBoolean(ScalarValuedFunction expr, int truth, int falsity)
Convert an int typed field into a boolean type. Unmapped values will be set to null.- Parameters:
expr- a function expression whose return type is an inttruth- int representing the value of truefalsity- int representing the value of false- Returns:
- the function that provides the conversion
-
asFloat
public static ScalarValuedFunction asFloat(String field)
Convert a numeric typed field into a float type. Note that precision may be lost during the conversion.- Parameters:
field- a field whose type is a number- Returns:
- the function that provides the conversion
-
asFloat
public static ScalarValuedFunction asFloat(ScalarValuedFunction expr)
Convert a numeric typed expression into a float type. Note that precision may be lost during the conversion.- Parameters:
expr- a function expression whose return type is a number- Returns:
- the function that provides the conversion
-
asDouble
public static ScalarValuedFunction asDouble(String field)
Convert a numeric typed field into a double type. Note that precision may be lost during the conversion.- Parameters:
field- a field whose type is a number- Returns:
- the function that provides the conversion
-
asDouble
public static ScalarValuedFunction asDouble(ScalarValuedFunction expr)
Convert a numeric typed expression into a double type. Note that precision may be lost during the conversion.- Parameters:
expr- a function expression whose return type is a number- Returns:
- the function that provides the conversion
-
asInt
public static ScalarValuedFunction asInt(String field)
Convert a numeric typed field into an integer type. Note that precision may be lost during the conversion.- Parameters:
field- a field whose type is a number- Returns:
- the function that provides the conversion
-
asInt
public static ScalarValuedFunction asInt(ScalarValuedFunction expr)
Convert a numeric typed expression into an integer type. Note that precision may be lost during the conversion.- Parameters:
expr- a function expression whose return type is a number- Returns:
- the function that provides the conversion
-
asLong
public static ScalarValuedFunction asLong(String field)
Convert a numeric typed field into a long type. Note that precision may be lost during the conversion.- Parameters:
field- a field whose type is a number- Returns:
- the function that provides the conversion
-
asLong
public static ScalarValuedFunction asLong(ScalarValuedFunction expr)
Convert a numeric typed expression into a long type. Note that precision may be lost during the conversion.- Parameters:
expr- a function expression whose return type is a number- Returns:
- the function that provides the conversion
-
asMoney
public static ScalarValuedFunction asMoney(String field)
Convert a numeric typed field into a money type. Note that precision may be lost during the conversion.- Parameters:
field- a field whose type is a number- Returns:
- the function that provides the conversion
-
asMoney
public static ScalarValuedFunction asMoney(ScalarValuedFunction expr)
Convert a numeric typed expression into a money type. Note that precision may be lost during the conversion.- Parameters:
expr- a function expression whose return type is a number- Returns:
- the function that provides the conversion
-
asNumeric
public static ScalarValuedFunction asNumeric(String field)
Convert a numeric typed field into a numeric type. The numeric type is typically backed by aBigDecimalobject.- Parameters:
field- a field whose type is a number- Returns:
- the function that provides the conversion
-
asTime
public static ScalarValuedFunction asTime(String field)
Convert a timestamp typed field into a time field. This down casting essentially drops the date portion of the timestamp field leaving only the time portion. The timestamp is interpreted using the timezone offset associated with it.- Parameters:
field- a field whose type is timestamp- Returns:
- the function that provides the conversion
-
asTime
public static ScalarValuedFunction asTime(ScalarValuedFunction expr)
Convert a timestamp expression result into a time field. This down casting essentially drops the date portion of the timestamp field leaving only the time portion. The timestamp is interpreted using the timezone offset associated with it.- Parameters:
expr- a function expression whose return type is timestamp- Returns:
- the function that provides the conversion
-
asNumeric
public static ScalarValuedFunction asNumeric(ScalarValuedFunction expr)
Convert a numeric typed expression into a numeric type. The numeric type is typically backed by aBigDecimalobject.- Parameters:
expr- a function expression whose return type is a number- Returns:
- the function that provides the conversion
-
asDate
public static ScalarValuedFunction asDate(String field)
Convert a timestamp typed field into a date field. This down casting essentially drops the time portion of the timestamp field leaving only the date portion.- Parameters:
field- a field whose type is timestamp- Returns:
- the function that provides the conversion
-
asDate
public static ScalarValuedFunction asDate(ScalarValuedFunction expr)
Convert a timestamp expression result into a date field. This down casting essentially drops the time portion of the timestamp field leaving only the date portion.- Parameters:
expr- a function expression whose return type is timestamp- Returns:
- the function that provides the conversion
-
toBinary
public static ScalarValuedFunction toBinary(String fieldName)
Convert a string typed field into a binary type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toBinary
public static ScalarValuedFunction toBinary(ScalarValuedFunction expr)
Convert a string typed expression into a binary type.- Parameters:
expr- an expression whose type is string- Returns:
- the function that provides the conversion
-
toChar
public static ScalarValuedFunction toChar(String fieldName)
Convert a string typed field into a char type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toChar
public static ScalarValuedFunction toChar(ScalarValuedFunction expr)
Convert a string typed expression into a char type.- Parameters:
expr- an expression whose type is string- Returns:
- the function that provides the conversion
-
toDouble
public static ScalarValuedFunction toDouble(String field)
Convert a string typed field into a double type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toDouble
public static ScalarValuedFunction toDouble(ScalarValuedFunction expr)
Convert a string typed expression into a double type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toDouble
public static ScalarValuedFunction toDouble(String field, String format)
Convert a string typed field into a double type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert strings to doubles- Returns:
- the function that provides the conversion
-
toDouble
public static ScalarValuedFunction toDouble(String field, NumberFormat format)
Convert a string typed field into a double type using the given format.- Parameters:
field- a field whose type is stringformat- formatter instance to use to convert strings to doubles- Returns:
- the function that provides the conversion
-
toDouble
public static ScalarValuedFunction toDouble(ScalarValuedFunction expr, NumberFormat format)
Convert a string typed expression into a double type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- formatter instance to use to convert strings to doubles- Returns:
- the function that provides the conversion
-
toFloat
public static ScalarValuedFunction toFloat(String field)
Convert a string typed field into a float type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toFloat
public static ScalarValuedFunction toFloat(ScalarValuedFunction expr)
Convert a string typed expression into a float type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toFloat
public static ScalarValuedFunction toFloat(String field, String format)
Convert a string typed field into a float type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert string to floats- Returns:
- the function that provides the conversion
-
toFloat
public static ScalarValuedFunction toFloat(String field, NumberFormat format)
Convert a string typed field into a float type using the given format.- Parameters:
field- a field whose type is stringformat- formatter instance to use to convert strings to floats- Returns:
- the function that provides the conversion
-
toFloat
public static ScalarValuedFunction toFloat(ScalarValuedFunction expr, NumberFormat format)
Convert a string typed expression into a float type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- formatter instance to use to convert strings to floats- Returns:
- the function that provides the conversion
-
toInt
public static ScalarValuedFunction toInt(String field)
Convert a string typed field into a integer type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toInt
public static ScalarValuedFunction toInt(ScalarValuedFunction expr)
Convert a string typed expression into a integer type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toInt
public static ScalarValuedFunction toInt(String field, String format)
Convert a string typed field into a integer type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert strings to integers- Returns:
- the function that provides the conversion
-
toInt
public static ScalarValuedFunction toInt(String field, NumberFormat format)
Convert a string typed field into a integer type using the given format.- Parameters:
field- a field whose type is stringformat- formatter instance to use to convert strings to integers- Returns:
- the function that provides the conversion
-
toInt
public static ScalarValuedFunction toInt(ScalarValuedFunction expr, NumberFormat format)
Convert a string typed expression into a integer type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- formatter instance to use to convert strings to integers- Returns:
- the function that provides the conversion
-
toLong
public static ScalarValuedFunction toLong(String field)
Convert a string typed field into a long type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toLong
public static ScalarValuedFunction toLong(ScalarValuedFunction expr)
Convert a string typed expression into a long type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toLong
public static ScalarValuedFunction toLong(String field, String format)
Convert a string typed field into a long type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert strings to longs- Returns:
- the function that provides the conversion
-
toLong
public static ScalarValuedFunction toLong(String field, NumberFormat format)
Convert a string typed field into a long type using the given format.- Parameters:
field- a field whose type is stringformat- formatter instance to use to convert strings to longs- Returns:
- the function that provides the conversion
-
toLong
public static ScalarValuedFunction toLong(ScalarValuedFunction expr, NumberFormat format)
Convert a string typed expression into a long type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- formatter instance to use to convert strings to longs- Returns:
- the function that provides the conversion
-
toMoney
public static ScalarValuedFunction toMoney(String field)
Convert a string typed field into a money type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toMoney
public static ScalarValuedFunction toMoney(ScalarValuedFunction expr)
Convert a string typed expression into a money type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toMoney
public static ScalarValuedFunction toMoney(String field, String format)
Convert a string typed field into a money type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert strings to money- Returns:
- the function that provides the conversion
-
toMoney
public static ScalarValuedFunction toMoney(String field, NumberFormat format)
Convert a string typed field into a money type using the given format.- Parameters:
field- a field whose type is stringformat- formatter instance to use to convert strings to money- Returns:
- the function that provides the conversion
-
toMoney
public static ScalarValuedFunction toMoney(ScalarValuedFunction expr, NumberFormat format)
Convert a string typed expression into a money type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- formatter instance to use to convert strings to money- Returns:
- the function that provides the conversion
-
toNumeric
public static ScalarValuedFunction toNumeric(String field)
Convert a string typed field into a numeric type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toNumeric
public static ScalarValuedFunction toNumeric(ScalarValuedFunction expr)
Convert a string typed expression into a numeric type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toNumeric
public static ScalarValuedFunction toNumeric(String field, String format)
Convert a string typed field into a numeric type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert strings to numerics- Returns:
- the function that provides the conversion
-
toNumeric
public static ScalarValuedFunction toNumeric(String field, NumberFormat format)
Convert a string typed field into a numeric type using the given format.- Parameters:
field- a field whose type is stringformat- formatter instance to use to convert strings to numeric- Returns:
- the function that provides the conversion
-
toNumeric
public static ScalarValuedFunction toNumeric(ScalarValuedFunction expr, NumberFormat format)
Convert a string typed expression into a numeric type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- formatter instance to use to convert strings to numeric- Returns:
- the function that provides the conversion
-
toBoolean
public static ScalarValuedFunction toBoolean(String field, String truth, String falsity)
Convert a string typed field into a boolean type.- Parameters:
field- a field whose type is stringtruth- text representing the value of truefalsity- text representing the value of false- Returns:
- the function that provides the conversion
-
toBoolean
public static ScalarValuedFunction toBoolean(ScalarValuedFunction expr, String truth, String falsity)
Convert a string typed expression into a boolean type.- Parameters:
expr- a function expression whose return type is stringtruth- text representing the value of truefalsity- text representing the value of false- Returns:
- the function that provides the conversion
-
toBoolean
public static ScalarValuedFunction toBoolean(String field, TruthValues mapping)
Convert a string typed field into a boolean type.- Parameters:
field- a field whose type is stringmapping- a truthvalue mapping between boolean values and strings- Returns:
- the function that provides the conversion
-
toBoolean
public static ScalarValuedFunction toBoolean(ScalarValuedFunction expr, TruthValues mapping)
Convert a string typed expression into a boolean type.- Parameters:
expr- a function expression whose return type is stringmapping- a truthvalue mapping between boolean values and strings- Returns:
- the function that provides the conversion
-
toDate
public static ScalarValuedFunction toDate(String field)
Convert a string typed field into a date type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toDate
public static ScalarValuedFunction toDate(ScalarValuedFunction expr)
Convert a string typed expression into a date type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toDate
public static ScalarValuedFunction toDate(String field, String format)
Convert a string typed field into a date type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert string to date- Returns:
- the function that provides the conversion
-
toDate
public static ScalarValuedFunction toDate(String field, DateTimeFormatting format)
Convert a string typed field into a date type using the given format.- Parameters:
field- a field whose type is stringformat- format instance to use to convert string to date- Returns:
- the function that provides the conversion
-
toDate
public static ScalarValuedFunction toDate(ScalarValuedFunction expr, DateTimeFormatting format)
Convert a string typed expression into a date type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- format instance to use to convert string to date- Returns:
- the function that provides the conversion
-
toTime
public static ScalarValuedFunction toTime(String field)
Convert a string typed field into a time type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toTime
public static ScalarValuedFunction toTime(ScalarValuedFunction expr)
Convert a string typed expression into a time type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toTime
public static ScalarValuedFunction toTime(String field, String format)
Convert a string typed field into a time type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert string to time- Returns:
- the function that provides the conversion
-
toTime
public static ScalarValuedFunction toTime(String field, DateTimeFormatting format)
Convert a string typed field into a time type using the given format.- Parameters:
field- a field whose type is stringformat- format instance to use to convert string to time- Returns:
- the function that provides the conversion
-
toTime
public static ScalarValuedFunction toTime(ScalarValuedFunction expr, DateTimeFormatting format)
Convert a string typed expression into a time type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- format instance to use to convert string to time- Returns:
- the function that provides the conversion
-
toTimestamp
public static ScalarValuedFunction toTimestamp(String field)
Convert a string typed field into a timestamp type.- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toTimestamp
public static ScalarValuedFunction toTimestamp(ScalarValuedFunction expr)
Convert a string typed expression into a timestamp type.- Parameters:
expr- a function expression whose return type is string- Returns:
- the function that provides the conversion
-
toTimestamp
public static ScalarValuedFunction toTimestamp(String field, String format)
Convert a string typed field into a timestamp type using the given format.- Parameters:
field- a field whose type is stringformat- format specification to use to convert string to timestamp- Returns:
- the function that provides the conversion
-
toTimestamp
public static ScalarValuedFunction toTimestamp(String field, DateTimeFormatting format)
Convert a string typed field into a timestamp type using the given format.- Parameters:
field- a field whose type is stringformat- format instance to use to convert string to timestamp- Returns:
- the function that provides the conversion
-
toTimestamp
public static ScalarValuedFunction toTimestamp(ScalarValuedFunction expr, DateTimeFormatting format)
Convert a string typed expression into a timestamp type using the given format.- Parameters:
expr- a function expression whose return type is stringformat- format instance to use to convert string to timestamp- Returns:
- the function that provides the conversion
-
toString
public static ScalarValuedFunction toString(String field)
Convert a scalar type field into a string value. The default formatting per data type will be used. To specify a format, usetoText(String, Format).- Parameters:
field- a field whose type is string- Returns:
- the function that provides the conversion
-
toString
public static ScalarValuedFunction toString(ScalarValuedFunction expr)
Convert the value of an expression into a string value. The default formatting per data type will be used. To specify a format, usetoText(String, Format).- Parameters:
expr- the expression to convert- Returns:
- the function that provides the conversion
-
toText
public static ScalarValuedFunction toText(String field, Format formatter)
Convert a scalar type field into text using the given format. The format object instance must be able to format the token type of the field being converted.- Parameters:
field- a field whose type is stringformatter- format instance to use to convert values to strings- Returns:
- the function that provides the conversion
-
toText
public static ScalarValuedFunction toText(ScalarValuedFunction expr, Format formatter)
Convert the value of an expression into text using the given format. The format object instance must be able to format the token type of the field being converted.- Parameters:
expr- the expression to convertformatter- format instance to use to convert values to strings- Returns:
- the function that provides the conversion
-
toText
public static ScalarValuedFunction toText(String field, String format)
Convert a scalar type field into text using the given format. The format specification must be acceptable to a formatter for the token type of the field being converted.- Parameters:
field- a field whose type is stringformat- format specification to use to convert values to strings- Returns:
- the function that provides the conversion
-
toText
public static ScalarValuedFunction toText(ScalarValuedFunction expr, String format)
Convert the value of an expression into text using the given format. The format specification must be acceptable to a formatter for the token type of the field being converted.- Parameters:
expr- the expression to convertformat- format specification to use to convert values to strings- Returns:
- the function that provides the conversion
-
-