Class SparkUdt
- java.lang.Object
-
- org.apache.cassandra.spark.data.converter.types.complex.SparkUdt
-
-
Constructor Summary
Constructors Constructor Description SparkUdt(SparkSqlTypeConverter converter, org.apache.cassandra.spark.data.CqlField.CqlUdt udt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object first, java.lang.Object second)org.apache.spark.sql.types.DataTypedataType(org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)booleanequals(java.lang.Object first, java.lang.Object second)org.apache.cassandra.spark.data.CqlFieldfield(int position)intsize()java.lang.ObjectsparkSqlRowValue(org.apache.spark.sql.catalyst.expressions.GenericInternalRow row, int position)java.lang.ObjectsparkSqlRowValue(org.apache.spark.sql.Row row, int position)SparkTypesparkType()SparkTypesparkType(int position)java.util.List<SparkType>sparkTypes()java.lang.ObjecttoSparkSqlType(java.lang.Object value, boolean isFrozen)java.lang.ObjecttoTestRowType(java.lang.Object value)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.apache.cassandra.spark.data.converter.types.SparkType
compare, dataType, equalsTo, nativeSparkSqlRowValue, nativeSparkSqlRowValue
-
-
-
-
Constructor Detail
-
SparkUdt
public SparkUdt(SparkSqlTypeConverter converter, org.apache.cassandra.spark.data.CqlField.CqlUdt udt)
-
-
Method Detail
-
field
public org.apache.cassandra.spark.data.CqlField field(int position)
-
dataType
public org.apache.spark.sql.types.DataType dataType(org.apache.cassandra.bridge.BigNumberConfig bigNumberConfig)
-
sparkSqlRowValue
public java.lang.Object sparkSqlRowValue(org.apache.spark.sql.catalyst.expressions.GenericInternalRow row, int position)- Specified by:
sparkSqlRowValuein interfaceSparkType- 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:
sparkSqlRowValuein interfaceSparkType- 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.
-
sparkTypes
public java.util.List<SparkType> sparkTypes()
-
size
public int size()
-
sparkType
public SparkType sparkType()
-
sparkType
public SparkType sparkType(int position)
-
compareTo
public int compareTo(java.lang.Object first, java.lang.Object second)
-
equals
public boolean equals(java.lang.Object first, java.lang.Object second)
-
toTestRowType
public java.lang.Object toTestRowType(java.lang.Object value)
- Specified by:
toTestRowTypein interfaceSparkType- Parameters:
value- SparkSQL value.- Returns:
- SparkSQL value converted back into test type - used only in the test system.
-
toSparkSqlType
public java.lang.Object toSparkSqlType(java.lang.Object value, boolean isFrozen)- Specified by:
toSparkSqlTypein interfaceSparkType- Parameters:
value- the Cassandra value.isFrozen- true if the type is frozen.- Returns:
- the value mapped to the Spark equivalent data type.
-
-