class Row extends Serializable
- Alphabetic
- By Inheritance
- Row
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Row(values: Array[Any], schema: Option[StructType])
- Attributes
- protected
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 apply(index: Int): Any
Returns the value of the column in the row at the given index.
Returns the value of the column in the row at the given index. Alias of get
- Since
0.1.0
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
Returns a clone of this row object.
- def convertValueToString(value: Any): String
- Attributes
- protected
- def copy(): Row
Returns a clone of this row.
Returns a clone of this row.
- Since
0.1.0
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(obj: Any): Boolean
Returns true iff the given row equals this row.
Returns true iff the given row equals this row.
- Definition Classes
- Row → AnyRef → Any
- Since
0.1.0
- def fieldIndex(fieldName: String): Int
Returns the index of the field with the specified name.
Returns the index of the field with the specified name.
- fieldName
the name of the field.
- returns
the index of the specified field.
- Since
1.15.0
- Exceptions thrown
UnsupportedOperationExceptionif schema information is not available.
- def get(index: Int): Any
Returns the value of the column in the row at the given index.
Returns the value of the column in the row at the given index.
- Since
0.1.0
- def getAs[T](index: Int)(implicit classTag: ClassTag[T]): T
Returns the value at the specified column index and casts it to the desired type
T.Returns the value at the specified column index and casts it to the desired type
T.Example:
val row = Row(1, "Alice", 95.5) row.getAs[Int](0) // Returns 1 as an Int row.getAs[String](1) // Returns "Alice" as a String row.getAs[Double](2) // Returns 95.5 as a Double
- T
the expected type of the value at the specified column index.
- index
the zero-based column index within the row.
- returns
the value at the specified column index cast to type
T.
- Since
1.15.0
- Exceptions thrown
ArrayIndexOutOfBoundsExceptionif the column index is out of bounds.ClassCastExceptionif the value at the given index cannot be cast to typeT.
- def getAs[T](fieldName: String)(implicit classTag: ClassTag[T]): T
Returns the value for the specified field name and casts it to the desired type
T.Returns the value for the specified field name and casts it to the desired type
T.Example:
val schema = StructType(Seq(StructField("name", StringType), StructField("value", IntegerType))) val data = Seq(Row("Alice", 1)) val df = session.createDataFrame(data, schema) val row = df.collect()(0) row.getAs[String]("name") // Returns "Alice" as a String row.getAs[Int]("value") // Returns 1 as an Int
- T
the expected type of the value for the specified field name.
- fieldName
the name of the field within the row.
- returns
the value for the specified field name cast to type
T.
- Since
1.15.0
- Exceptions thrown
ClassCastExceptionif the value of the field cannot be cast to typeT.IllegalArgumentExceptionif the name of the field is not part of the row schema.UnsupportedOperationExceptionif the schema information is not available.
- def getBinary(index: Int): Array[Byte]
Returns the value of the column at the given index as a Byte array value.
Returns the value of the column at the given index as a Byte array value.
- Since
0.2.0
- def getBoolean(index: Int): Boolean
Returns the value of the column at the given index as a Boolean value
Returns the value of the column at the given index as a Boolean value
- Since
0.1.0
- def getByte(index: Int): Byte
Returns the value of the column at the given index as a Byte value.
Returns the value of the column at the given index as a Byte value. Casts Short, Int, Long number to Byte if possible.
- Since
0.1.0
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def getDate(index: Int): Date
Returns the value of the column at the given index as a Date value
Returns the value of the column at the given index as a Date value
- Since
0.1.0
- def getDecimal(index: Int): BigDecimal
Returns the value of the column at the given index as a BigDecimal value
Returns the value of the column at the given index as a BigDecimal value
- Since
0.1.0
- def getDouble(index: Int): Double
Returns the value of the column at the given index as a Double value.
Returns the value of the column at the given index as a Double value. Casts Byte, Short, Int, Long, Float number to Double.
- Since
0.1.0
- def getFloat(index: Int): Float
Returns the value of the column at the given index as a Float value.
Returns the value of the column at the given index as a Float value. Casts Byte, Short, Int, Long and Double number to Float if possible.
- Since
0.1.0
- def getGeography(index: Int): Geography
Returns the value of the column at the given index as Geography class
Returns the value of the column at the given index as Geography class
- Since
0.2.0
- def getGeometry(index: Int): Geometry
Returns the value of the column at the given index as Geometry class
Returns the value of the column at the given index as Geometry class
- Since
1.12.0
- def getInt(index: Int): Int
Returns the value of the column at the given index as a Int value.
Returns the value of the column at the given index as a Int value. Casts Byte, Short, Long number to Int if possible.
- Since
0.1.0
- def getLong(index: Int): Long
Returns the value of the column at the given index as a Long value.
Returns the value of the column at the given index as a Long value. Casts Byte, Short, Int number to Long if possible.
- Since
0.1.0
- def getMap[T, U](index: Int): Map[T, U]
Returns the value of the column at the given index as a Map value.
Returns the value of the column at the given index as a Map value.
- Since
1.13.0
- def getMapOfVariant(index: Int): Map[String, Variant]
Returns the value of the column at the given index as a java map of Variant
Returns the value of the column at the given index as a java map of Variant
- Since
0.2.0
- def getObject(index: Int): Row
Returns the Snowflake Object value at the given index as a Row value.
Returns the Snowflake Object value at the given index as a Row value.
- Since
1.13.0
- def getSeq[T](index: Int): Seq[T]
Returns the value of the column at the given index as a Seq value.
Returns the value of the column at the given index as a Seq value.
- Since
1.13.0
- def getSeqOfVariant(index: Int): Seq[Variant]
Returns the value of the column at the given index as a Seq of Variant
Returns the value of the column at the given index as a Seq of Variant
- Since
0.2.0
- def getShort(index: Int): Short
Returns the value of the column at the given index as a Short value.
Returns the value of the column at the given index as a Short value. Casts Byte, Int, Long number to Short if possible.
- Since
0.1.0
- def getString(index: Int): String
Returns the value of the column at the given index as a String value.
Returns the value of the column at the given index as a String value. Returns geography data as string, if geography data of GeoJSON, WKT or EWKT is found.
- Since
0.1.0
- def getTime(index: Int): Time
Returns the value of the column at the given index as a Time value
Returns the value of the column at the given index as a Time value
- Since
0.2.0
- def getTimestamp(index: Int): Timestamp
Returns the value of the column at the given index as a Timestamp value
Returns the value of the column at the given index as a Timestamp value
- Since
0.2.0
- def getVariant(index: Int): Variant
Returns the value of the column at the given index as Variant class
Returns the value of the column at the given index as Variant class
- Since
0.2.0
- def hashCode(): Int
Calculates hashcode of this row.
Calculates hashcode of this row.
- Definition Classes
- Row → AnyRef → Any
- Since
0.1.0
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNullAt(index: Int): Boolean
Returns true if the value of the column at the given index is null, otherwise, returns false.
Returns true if the value of the column at the given index is null, otherwise, returns false.
- Since
0.1.0
- def length: Int
- def mkString(start: String, sep: String, end: String): String
Creates a string representation of all elements in this Row using the specified start string, separator, and end string.
Creates a string representation of all elements in this Row using the specified start string, separator, and end string.
Example:
val row = Row(1, "hello", 3.14, null) row.mkString("[", " | ", "]") // res: String = "[1 | hello | 3.14 | null]" val emptyRow = Row() emptyRow.mkString("(", ", ", ")") // res: String = "()"
- start
the string to prepend to the result
- sep
the separator string to insert between field values
- end
the string to append to the result
- returns
a string containing all field values formatted with the specified start, separator, and end
- Since
1.17.0
- def mkString(sep: String): String
Creates a string representation of all elements in this Row using the specified separator.
Creates a string representation of all elements in this Row using the specified separator.
Example:
val row = Row(1, "hello", 3.14, null) row.mkString(", ") // res: String = "1, hello, 3.14, null" row.mkString(" | ") // res: String = "1 | hello | 3.14 | null" row.mkString("") // res: String = "1hello3.14null"
- sep
the separator string to insert between field values
- returns
a string containing all field values separated by the given separator
- Since
1.17.0
- def mkString: String
Creates a string representation of all elements in this Row without any separators.
Creates a string representation of all elements in this Row without any separators.
Example:
val row = Row(1, "hello", 3.14, null) row.mkString // res: String = "1hello3.14null"
- returns
a string containing all field values concatenated together
- Since
1.17.0
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def size: Int
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toSeq: Seq[Any]
Converts this Row to a Seq
Converts this Row to a Seq
- Since
0.1.0
- def toString(): String
Returns a string value to represent the content of this row
Returns a string value to represent the content of this row
- Definition Classes
- Row → AnyRef → Any
- Since
0.1.0
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)