Interface SparkSqlTypeConverter

  • All Superinterfaces:
    org.apache.cassandra.spark.data.TypeConverter

    public interface SparkSqlTypeConverter
    extends org.apache.cassandra.spark.data.TypeConverter
    Interface defining how to map a Cassandra `CqlField.CqlType` to an equivalent `SparkType`.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String IMPLEMENTATION_FQCN  
      • Fields inherited from interface org.apache.cassandra.spark.data.TypeConverter

        IDENTITY
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType, org.apache.spark.sql.catalyst.expressions.GenericInternalRow row, int position)  
      java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType, org.apache.spark.sql.Row row, int position)  
      default java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField cqlField, org.apache.spark.sql.catalyst.expressions.GenericInternalRow row, int position)  
      default java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField cqlField, org.apache.spark.sql.Row row, int position)  
      default org.apache.spark.sql.types.DataType sparkSqlType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType)
      Maps Cassandra CQL type to equivalent Spark DataType object.
      org.apache.spark.sql.types.DataType sparkSqlType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType, org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)
      Maps Cassandra CQL type to equivalent Spark DataType object.
      default org.apache.spark.sql.types.DataType sparkSqlType​(org.apache.cassandra.spark.data.CqlField cqlField, org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)
      Maps Cassandra CQL type to equivalent Spark DataType object.
      SparkType toSparkType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType)
      Maps Cassandra CQL type to equivalent SparkType object.
      default java.lang.Object toTestRowType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType, java.lang.Object value)
      Maps SparkSQL value back to type used in the test system to verify, used only in the test systsm.
      default java.lang.Object toTestRowType​(org.apache.cassandra.spark.data.CqlField cqlField, java.lang.Object value)
      Maps SparkSQL value back to type used in the test system to verify, used only in the test systsm.
      • Methods inherited from interface org.apache.cassandra.spark.data.TypeConverter

        convert
    • Field Detail

    • Method Detail

      • sparkSqlRowValue

        default java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField cqlField,
                                                  org.apache.spark.sql.catalyst.expressions.GenericInternalRow row,
                                                  int position)
        Parameters:
        cqlField - Cassandra CQL field
        row - SparkSQL `org.apache.spark.sql.catalyst.expressions.GenericInternalRow` row
        position - column position in the row.
        Returns:
        the SparkSQL value at position in the row
      • sparkSqlRowValue

        java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType,
                                          org.apache.spark.sql.catalyst.expressions.GenericInternalRow row,
                                          int position)
        Parameters:
        cqlType - Cassandra CQL type
        row - SparkSQL `org.apache.spark.sql.catalyst.expressions.GenericInternalRow` row
        position - column position in the row.
        Returns:
        the SparkSQL value at position in the row
      • sparkSqlRowValue

        default java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField cqlField,
                                                  org.apache.spark.sql.Row row,
                                                  int position)
        Parameters:
        cqlField - Cassandra CQL field
        row - SparkSQL `org.apache.spark.sql.Row` row
        position - column position in the row.
        Returns:
        the SparkSQL value at position in the row
      • sparkSqlRowValue

        java.lang.Object sparkSqlRowValue​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType,
                                          org.apache.spark.sql.Row row,
                                          int position)
        Parameters:
        cqlType - Cassandra CQL type
        row - SparkSQL `org.apache.spark.sql.Row` row
        position - column position in the row.
        Returns:
        the SparkSQL value at position in the row
      • toSparkType

        SparkType toSparkType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType)
        Maps Cassandra CQL type to equivalent SparkType object.
        Parameters:
        cqlType - Cassandra CQL type
        Returns:
        equivalent Spark `org.apache.cassandra.spark.data.converter.types.SparkType`
      • sparkSqlType

        default org.apache.spark.sql.types.DataType sparkSqlType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType)
        Maps Cassandra CQL type to equivalent Spark DataType object.
        Parameters:
        cqlType - Cassandra CQL type
        Returns:
        equivalent Spark `org.apache.spark.sql.types.DataType`
      • sparkSqlType

        default org.apache.spark.sql.types.DataType sparkSqlType​(org.apache.cassandra.spark.data.CqlField cqlField,
                                                                 org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)
        Maps Cassandra CQL type to equivalent Spark DataType object.
        Parameters:
        cqlField - Cassandra CQL field
        bigNumberConfig - BigNumberConfig if
        Returns:
        equivalent Spark `org.apache.spark.sql.types.DataType`
      • sparkSqlType

        org.apache.spark.sql.types.DataType sparkSqlType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType,
                                                         org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)
        Maps Cassandra CQL type to equivalent Spark DataType object.
        Parameters:
        cqlType - Cassandra CQL type
        bigNumberConfig - BigNumberConfig if
        Returns:
        equivalent Spark `org.apache.spark.sql.types.DataType`
      • toTestRowType

        default java.lang.Object toTestRowType​(org.apache.cassandra.spark.data.CqlField cqlField,
                                               java.lang.Object value)
        Maps SparkSQL value back to type used in the test system to verify, used only in the test systsm.
        Parameters:
        cqlField - Cassandra CQL field
        value - SparkSQL value
        Returns:
        equivalent value used in test system.
      • toTestRowType

        default java.lang.Object toTestRowType​(org.apache.cassandra.spark.data.CqlField.CqlType cqlType,
                                               java.lang.Object value)
        Maps SparkSQL value back to type used in the test system to verify, used only in the test systsm.
        Parameters:
        cqlType - Cassandra CQL type
        value - SparkSQL value
        Returns:
        equivalent value used in test system.