Snowpark Scala API Reference1.19.1 < Back


# Packages

-  package root
  Definition Classes
    root
-  package com
  Definition Classes
    root
-  package snowflake
  Definition Classes
    com
-  package snowpark
  Definition Classes
    snowflake
-  package types

  This package contains all Snowpark logical types.

  This package contains all Snowpark logical types.

  Definition Classes
    snowpark
  Since

    0.1.0

-  package udaf
  Definition Classes
    snowpark
-  package udtf
  Definition Classes
    snowpark
- AggregateFunction
- AsyncJob
- CaseExpr
- Column
- CopyableDataFrame
- CopyableDataFrameAsyncActor
- DataFrame
- DataFrameAsyncActor
- DataFrameNaFunctions
- DataFrameReader
- DataFrameStatFunctions
- DataFrameWriter
- DataFrameWriterAsyncActor
- DeleteResult
- FileOperation
- GetResult
- GroupingSets
- HasCachedResult
- MatchedClauseBuilder
- MergeBuilder
- MergeBuilderAsyncActor
- MergeResult
- MergeTypedAsyncJob
- NotMatchedClauseBuilder
- PublicPreview
- PutResult
- RelationalGroupedDataFrame
- Row
- SProcRegistration
- SaveMode
- Session
- SnowparkClientException
- StoredProcedure
- TableFunction
- TypedAsyncJob
- UDAFRegistration
- UDFRegistration
- UDTFRegistration
- Updatable
- UpdatableAsyncActor
- UpdateResult
- UserDefinedFunction
- Window
- WindowSpec
- WriteFileResult
- functions
- tableFunctions

c

com.snowflake.snowpark

# Row

###
Companion object Row

#### class Row extends Serializable

Represents a row returned by the evaluation of a DataFrame.

Since

  0.1.0

Linear Supertypes
Serializable, AnyRef, Any

Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. Row
2. Serializable
3. AnyRef
4. Any

1. Hide All
2. Show All

Visibility

1. Public
2. Protected

### Instance Constructors

1.  new Row(values: Array[Any], schema: Option[StructType])
   Attributes
     protected

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##: Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  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

5.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
6.  def clone(): AnyRef

   Returns a clone of this row object.

   Returns a clone of this row object. Alias of copy

   Definition Classes
     Row → AnyRef
   Since

     0.1.0

7.  def convertValueToString(value: Any): String
   Attributes
     protected
8.  def copy(): Row

   Returns a clone of this row.

   Returns a clone of this row.

   Since

     0.1.0

9.  final def eq(arg0: AnyRef): Boolean
   Definition Classes
     AnyRef
10.  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

11.  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

      `UnsupportedOperationException` if schema information is not available.

12.  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

13.  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

      `ArrayIndexOutOfBoundsException` if the column index is out of bounds.

      `ClassCastException` if the value at the given index cannot be cast to type `T`.

14.  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

      `ClassCastException` if the value of the field cannot be cast to type `T`.

      `IllegalArgumentException` if the name of the field is not part of the row schema.

      `UnsupportedOperationException` if the schema information is not available.

15.  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

16.  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

17.  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

18.  final def getClass(): Class[_ <: AnyRef]
    Definition Classes
      AnyRef → Any
    Annotations
      @HotSpotIntrinsicCandidate() @native()
19.  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

20.  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

21.  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

22.  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

23.  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

24.  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

25.  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

26.  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

27.  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

28.  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

29.  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

30.  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

31.  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

32.  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

33.  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

34.  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

35.  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

36.  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

37.  def hashCode(): Int

    Calculates hashcode of this row.

    Calculates hashcode of this row.

    Definition Classes
      Row → AnyRef → Any
    Since

      0.1.0

38.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
39.  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

40.  def length: Int

    Total number of Column in this Row

    Total number of Column in this Row

    Since

      0.1.0

41.  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

42.  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

43.  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

44.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
45.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @HotSpotIntrinsicCandidate() @native()
46.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @HotSpotIntrinsicCandidate() @native()
47.  def size: Int

    Total number of Column in this Row.

    Total number of Column in this Row. Alias of length

    Since

      0.1.0

48.  final def synchronized[T0](arg0: => T0): T0
    Definition Classes
      AnyRef
49.  def toSeq: Seq[Any]

    Converts this Row to a Seq

    Converts this Row to a Seq

    Since

      0.1.0

50.  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

51.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])
52.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException]) @native()
53.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws(classOf[java.lang.InterruptedException])

### Deprecated Value Members

1.  def finalize(): Unit
   Attributes
     protected[lang]
   Definition Classes
     AnyRef
   Annotations
     @throws(classOf[java.lang.Throwable]) @Deprecated
   Deprecated

     (Since version 9)

### Inherited from Serializable

### Inherited from AnyRef

### Inherited from Any

### Getter Functions

### Utility Functions

### Ungrouped