Package org.hpccsystems.spark
Class GenericRowRecordAccessor
- java.lang.Object
-
- org.hpccsystems.spark.GenericRowRecordAccessor
-
- All Implemented Interfaces:
org.hpccsystems.dfs.client.IRecordAccessor
public class GenericRowRecordAccessor extends Object implements org.hpccsystems.dfs.client.IRecordAccessor
An implementation of IRecordAccessor that allows IRecordWriter to access Spark GenericRows.
-
-
Constructor Summary
Constructors Constructor Description GenericRowRecordAccessor(org.apache.spark.sql.types.StructType schema)
GenericRowRecordAccessor(org.hpccsystems.commons.ecl.FieldDef fieldDef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hpccsystems.dfs.client.IRecordAccessor
getChildRecordAccessor(int index)
Gets the child record accessor.org.hpccsystems.commons.ecl.FieldDef
getFieldDefinition(int index)
Gets the field definition.Object
getFieldValue(int index)
Gets the field value.int
getNumFields()
Gets the num fields.org.hpccsystems.dfs.client.IRecordAccessor
setRecord(Object rd)
Sets the record.
-
-
-
Constructor Detail
-
GenericRowRecordAccessor
public GenericRowRecordAccessor(org.apache.spark.sql.types.StructType schema) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
GenericRowRecordAccessor
public GenericRowRecordAccessor(org.hpccsystems.commons.ecl.FieldDef fieldDef)
-
-
Method Detail
-
setRecord
public org.hpccsystems.dfs.client.IRecordAccessor setRecord(Object rd)
Description copied from interface:org.hpccsystems.dfs.client.IRecordAccessor
Sets the record.- Specified by:
setRecord
in interfaceorg.hpccsystems.dfs.client.IRecordAccessor
- Parameters:
rd
- the record- Returns:
- the i record accessor
-
getNumFields
public int getNumFields()
Description copied from interface:org.hpccsystems.dfs.client.IRecordAccessor
Gets the num fields.- Specified by:
getNumFields
in interfaceorg.hpccsystems.dfs.client.IRecordAccessor
- Returns:
- the num fields
-
getFieldValue
public Object getFieldValue(int index)
Description copied from interface:org.hpccsystems.dfs.client.IRecordAccessor
Gets the field value.- Specified by:
getFieldValue
in interfaceorg.hpccsystems.dfs.client.IRecordAccessor
- Parameters:
index
- the index- Returns:
- the field value
-
getFieldDefinition
public org.hpccsystems.commons.ecl.FieldDef getFieldDefinition(int index)
Description copied from interface:org.hpccsystems.dfs.client.IRecordAccessor
Gets the field definition.- Specified by:
getFieldDefinition
in interfaceorg.hpccsystems.dfs.client.IRecordAccessor
- Parameters:
index
- the index- Returns:
- the field definition
-
getChildRecordAccessor
public org.hpccsystems.dfs.client.IRecordAccessor getChildRecordAccessor(int index)
Description copied from interface:org.hpccsystems.dfs.client.IRecordAccessor
Gets the child record accessor.- Specified by:
getChildRecordAccessor
in interfaceorg.hpccsystems.dfs.client.IRecordAccessor
- Parameters:
index
- the index- Returns:
- the child record accessor
-
-