Class SchemaToStructTypeConverter
- java.lang.Object
-
- uk.gov.gchq.gaffer.spark.operation.dataframe.converter.schema.SchemaToStructTypeConverter
-
public class SchemaToStructTypeConverter extends Object
Converts a GafferSchema
to a SparkStructType
. Only groups that are present in the providedView
are used. Properties that can either automatically be converted into a value that can be used in a Spark Dataframe, or for which aConverter
is provided, will be present in theStructType
. If the same property is present in more than one group, then it must be consistent, i.e. of the same type. The converter will ignore any properties which share a name with the key property names required by a Spark Dataframe. This will result in these properties being missed if they are specified in the GafferSchema
. I.e ifRow
s are converted back into GafferElement
s it will not be possible to recreate the original Elements.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DIRECTED_COL_NAME
static String
DST_COL_NAME
static String
GROUP
static String
ID
static String
MATCHED_VERTEX_COL_NAME
static String
SRC_COL_NAME
static String
VERTEX_COL_NAME
-
Constructor Summary
Constructors Constructor Description SchemaToStructTypeConverter(Schema schema, View view, List<Converter> converters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Converter>
getConverterByProperty()
LinkedHashSet<String>
getGroups()
Map<String,Boolean>
getPropertyNeedsConversion()
org.apache.spark.sql.types.StructType
getStructType()
LinkedHashSet<String>
getUsedProperties()
-
-
-
Field Detail
-
GROUP
public static final String GROUP
- See Also:
- Constant Field Values
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
VERTEX_COL_NAME
public static final String VERTEX_COL_NAME
- See Also:
- Constant Field Values
-
SRC_COL_NAME
public static final String SRC_COL_NAME
- See Also:
- Constant Field Values
-
DST_COL_NAME
public static final String DST_COL_NAME
- See Also:
- Constant Field Values
-
DIRECTED_COL_NAME
public static final String DIRECTED_COL_NAME
- See Also:
- Constant Field Values
-
MATCHED_VERTEX_COL_NAME
public static final String MATCHED_VERTEX_COL_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getGroups
public LinkedHashSet<String> getGroups()
-
getStructType
public org.apache.spark.sql.types.StructType getStructType()
-
getUsedProperties
public LinkedHashSet<String> getUsedProperties()
-
-