public class SparkRow extends Object implements InternalRow, Serializable
InternalRow
wraps spark Row
.InternalRow.FieldGetter
Constructor and Description |
---|
SparkRow(RowType type,
org.apache.spark.sql.Row row) |
SparkRow(RowType type,
org.apache.spark.sql.Row row,
RowKind rowkind) |
Modifier and Type | Method and Description |
---|---|
InternalArray |
getArray(int i)
Returns the array value at the given position.
|
byte[] |
getBinary(int i)
Returns the binary value at the given position.
|
boolean |
getBoolean(int i)
Returns the boolean value at the given position.
|
byte |
getByte(int i)
Returns the byte value at the given position.
|
Decimal |
getDecimal(int i,
int precision,
int scale)
Returns the decimal value at the given position.
|
double |
getDouble(int i)
Returns the double value at the given position.
|
int |
getFieldCount()
Returns the number of fields in this row.
|
float |
getFloat(int i)
Returns the float value at the given position.
|
int |
getInt(int i)
Returns the integer value at the given position.
|
long |
getLong(int i)
Returns the long value at the given position.
|
InternalMap |
getMap(int i)
Returns the map value at the given position.
|
InternalRow |
getRow(int i,
int i1)
Returns the row value at the given position.
|
RowKind |
getRowKind()
Returns the kind of change that this row describes in a changelog.
|
short |
getShort(int i)
Returns the short value at the given position.
|
BinaryString |
getString(int i)
Returns the string value at the given position.
|
Timestamp |
getTimestamp(int i,
int precision)
Returns the timestamp value at the given position.
|
boolean |
isNullAt(int i)
Returns true if the element is null at the given position.
|
void |
setRowKind(RowKind rowKind)
Sets the kind of change that this row describes in a changelog.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createFieldGetter, getDataClass
public SparkRow(RowType type, org.apache.spark.sql.Row row)
public int getFieldCount()
InternalRow
The number does not include RowKind
. It is kept separately.
getFieldCount
in interface InternalRow
public RowKind getRowKind()
InternalRow
getRowKind
in interface InternalRow
RowKind
public void setRowKind(RowKind rowKind)
InternalRow
setRowKind
in interface InternalRow
RowKind
public boolean isNullAt(int i)
DataGetters
isNullAt
in interface DataGetters
public boolean getBoolean(int i)
DataGetters
getBoolean
in interface DataGetters
public byte getByte(int i)
DataGetters
getByte
in interface DataGetters
public short getShort(int i)
DataGetters
getShort
in interface DataGetters
public int getInt(int i)
DataGetters
getInt
in interface DataGetters
public long getLong(int i)
DataGetters
getLong
in interface DataGetters
public float getFloat(int i)
DataGetters
getFloat
in interface DataGetters
public double getDouble(int i)
DataGetters
getDouble
in interface DataGetters
public BinaryString getString(int i)
DataGetters
getString
in interface DataGetters
public Decimal getDecimal(int i, int precision, int scale)
DataGetters
The precision and scale are required to determine whether the decimal value was stored in
a compact representation (see Decimal
).
getDecimal
in interface DataGetters
public Timestamp getTimestamp(int i, int precision)
DataGetters
The precision is required to determine whether the timestamp value was stored in a compact
representation (see Timestamp
).
getTimestamp
in interface DataGetters
public byte[] getBinary(int i)
DataGetters
getBinary
in interface DataGetters
public InternalArray getArray(int i)
DataGetters
getArray
in interface DataGetters
public InternalMap getMap(int i)
DataGetters
getMap
in interface DataGetters
public InternalRow getRow(int i, int i1)
DataGetters
The number of fields is required to correctly extract the row.
getRow
in interface DataGetters
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.