Class SparkTuple

  • All Implemented Interfaces:
    java.util.Comparator<java.lang.Object>, SparkType

    public class SparkTuple
    extends java.lang.Object
    • Constructor Detail

      • SparkTuple

        public SparkTuple​(SparkSqlTypeConverter converter,
                          org.apache.cassandra.spark.data.CqlField.CqlTuple tuple)
    • Method Detail

      • dataType

        public org.apache.spark.sql.types.DataType dataType​(org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)
        Specified by:
        dataType in interface SparkType
        Parameters:
        bigNumberConfig - specifies the scale and precision to be used for VarInt and Decimal types.
        Returns:
        the SparkSQL `org.apache.spark.sql.types.DataType` for this SparkType.
      • collection

        public org.apache.cassandra.spark.data.CqlField.CqlCollection collection()
      • toSparkSqlType

        public java.lang.Object toSparkSqlType​(java.lang.Object value,
                                               boolean isFrozen)
        Specified by:
        toSparkSqlType in interface SparkType
        Parameters:
        value - the Cassandra value.
        isFrozen - true if the type is frozen.
        Returns:
        the value mapped to the Spark equivalent data type.
      • sparkSqlRowValue

        public java.lang.Object sparkSqlRowValue​(org.apache.spark.sql.catalyst.expressions.GenericInternalRow row,
                                                 int position)
        Specified by:
        sparkSqlRowValue in interface SparkType
        Parameters:
        row - a SparkSQL `org.apache.spark.sql.catalyst.expressions.GenericInternalRow`
        position - position in row
        Returns:
        the SparkSQL value at `position` in the `row` converted back into test type - used only in the test system.
      • sparkSqlRowValue

        public java.lang.Object sparkSqlRowValue​(org.apache.spark.sql.Row row,
                                                 int position)
        Specified by:
        sparkSqlRowValue in interface SparkType
        Parameters:
        row - a SparkSQL `org.apache.spark.sql.Row`
        position - position in row
        Returns:
        the SparkSQL value at `position` in the `row` converted back into test type - used only in the test system.
      • toTestRowType

        public java.lang.Object toTestRowType​(java.lang.Object value)
        Specified by:
        toTestRowType in interface SparkType
        Parameters:
        value - SparkSQL value.
        Returns:
        SparkSQL value converted back into test type - used only in the test system.
      • equalsTo

        public boolean equalsTo​(java.lang.Object first,
                                java.lang.Object second)
        Specified by:
        equalsTo in interface SparkType
      • compareTo

        public int compareTo​(java.lang.Object first,
                             java.lang.Object second)
        Specified by:
        compareTo in interface SparkType
      • sparkTypes

        public default java.util.List<SparkType> sparkTypes()
      • size

        public default int size()
      • sparkType

        public default SparkType sparkType()
      • sparkType

        public default SparkType sparkType​(int position)