Mapping rules for DseGraphFrame
DseGraphFrame uses mapping rules for column names and types.
Column mapping rules
DataFrame column names are the same as graph property names except in the following cases.
-
Conflict with column names reserved by
GraphFramewill result in an underscore (_) added to the property name. For example, theidcolumn will result in a property named_id.
| Reserved column name |
|---|
|
|
|
|
|
|
|
-
DseGraphFrameand Spark SQL are case insensitive by default. Column names that differ only in case will result in conflicts. Set the Spark propertyspark.sql.caseSensitive=trueto avoid case conflicts.$ dse spark --conf spark.sql.caseSensitive=true
Type mapping rules
DseGraphFrame and Spark SQL have a limited set of supported types.
A vertex is represented by a Row instance.
If the vertex has multiple properties, each property will be represented as a Spark SQL array with property values.
If a property has meta-properties it will be represented as StructType.
The value field of the struct contains the property value.
All other fields will represent the meta-properties.
| DSE Graph type | Spark SQL type | Conversion rules |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The number of nanoseconds from the beginning of the day. |
|
|
|
|
|
The |
|
|
The |
|
|
|
|
|
The |
|
|
The |
|
|
The |