class Variant extends AnyRef
Representation of Snowflake Variant data
- Since
0.2.0
- Alphabetic
- By Inheritance
- Variant
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Variant(obj: Any)
Creates a Variant from Object
Creates a Variant from Object
- Since
0.2.0
-
new
Variant(objects: Array[Any])
Creates a Variant from array
Creates a Variant from array
- Since
0.2.0
-
new
Variant(list: List[AnyRef])
Creates a Variant from Java List
Creates a Variant from Java List
- Since
0.2.0
-
new
Variant(seq: Seq[Any])
Creates a Variant from Scala Seq
Creates a Variant from Scala Seq
- Since
0.6.0
-
new
Variant(timestamp: Timestamp)
Creates a Variant from timestamp value
Creates a Variant from timestamp value
- Since
0.2.0
-
new
Variant(date: Date)
Creates a Variant from date value
Creates a Variant from date value
- Since
0.2.0
-
new
Variant(time: Time)
Creates a Variant from time value
Creates a Variant from time value
- Since
0.2.0
-
new
Variant(bytes: Array[Byte])
Creates a Variant from binary value
Creates a Variant from binary value
- Since
0.2.0
-
new
Variant(str: String)
Creates a Variant from String value.
Creates a Variant from String value. By default string is parsed as Json. If the parsing failed, the string is stored as text.
- Since
0.2.0
-
new
Variant(bool: Boolean)
Creates a Variant from Boolean value
Creates a Variant from Boolean value
- Since
0.2.0
-
new
Variant(num: BigInt)
Creates a Variant from Scala BigInt value
Creates a Variant from Scala BigInt value
- Since
0.6.0
-
new
Variant(num: BigInteger)
Creates a Variant from Java BigInteger value
Creates a Variant from Java BigInteger value
- Since
0.2.0
-
new
Variant(num: BigDecimal)
Creates a Variant from Scala BigDecimal value
Creates a Variant from Scala BigDecimal value
- Since
0.6.0
-
new
Variant(num: BigDecimal)
Creates a Variant from Java BigDecimal value
Creates a Variant from Java BigDecimal value
- Since
0.2.0
-
new
Variant(num: Short)
Creates a Variant from short integer value
Creates a Variant from short integer value
- Since
0.2.0
-
new
Variant(num: Int)
Creates a Variant from integer value
Creates a Variant from integer value
- Since
0.2.0
-
new
Variant(num: Long)
Creates a Variant from long integer value
Creates a Variant from long integer value
- Since
0.2.0
-
new
Variant(num: Float)
Creates a Variant from float value
Creates a Variant from float value
- Since
0.2.0
-
new
Variant(num: Double)
Creates a Variant from double value
Creates a Variant from double value
- Since
0.2.0
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
asArray(): Array[Variant]
Converts the variant as Array of Variant
Converts the variant as Array of Variant
- Since
0.2.0
-
def
asBigDecimal(): BigDecimal
Converts the variant as BigDecimal value
Converts the variant as BigDecimal value
- Since
0.6.0
-
def
asBigInt(): BigInt
Converts the variant as Scala BigInt value
Converts the variant as Scala BigInt value
- Since
0.6.0
-
def
asBinary(): Array[Byte]
Converts the variant as binary value
Converts the variant as binary value
- Since
0.2.0
-
def
asBoolean(): Boolean
Converts the variant as boolean value
Converts the variant as boolean value
- Since
0.2.0
-
def
asDate(): Date
Converts the variant as date value
Converts the variant as date value
- Since
0.2.0
-
def
asDouble(): Double
Converts the variant as double value
Converts the variant as double value
- Since
0.2.0
-
def
asFloat(): Float
Converts the variant as float value
Converts the variant as float value
- Since
0.2.0
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asInt(): Int
Converts the variant as integer value
Converts the variant as integer value
- Since
0.2.0
-
def
asJsonNode(): JsonNode
Return the variant value as a JsonNode.
Return the variant value as a JsonNode. This function allows to read the JSON object directly as JsonNode from variant column rather parsing it as String Example - to get the first value from array for key "a"
val sv = new Variant("{\"a\": [1, 2], \"b\": 3, \"c\": \"xyz\"}") println(sv.asJsonNode().get("a").get(0)) output 1
- Since
1.14.0
-
def
asJsonString(): String
Converts the variant as valid Json String
Converts the variant as valid Json String
- Since
0.2.0
-
def
asLong(): Long
Converts the variant as long value
Converts the variant as long value
- Since
0.2.0
-
def
asMap(): Map[String, Variant]
Converts the variant as Scala Map of String to Variant
Converts the variant as Scala Map of String to Variant
- Since
0.6.0
-
def
asSeq(): Seq[Variant]
Converts the variant as Scala Seq of Variant
Converts the variant as Scala Seq of Variant
- Since
0.6.0
-
def
asShort(): Short
Converts the variant as short value
Converts the variant as short value
- Since
0.2.0
-
def
asString(): String
Converts the variant as string value
Converts the variant as string value
- Since
0.2.0
-
def
asTime(): Time
Converts the variant as time value
Converts the variant as time value
- Since
0.2.0
-
def
asTimestamp(): Timestamp
Converts the variant as timestamp value
Converts the variant as timestamp value
- Since
0.2.0
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
Checks whether two Variants are equal
Checks whether two Variants are equal
- Definition Classes
- Variant → AnyRef → Any
- Since
0.2.0
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
Calculates hashcode of this Variant
Calculates hashcode of this Variant
- Definition Classes
- Variant → AnyRef → Any
- Since
0.6.0
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
An alias of asString
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated