Closed gavinkflam closed 3 years ago
Geni Version: 0.0.38
user=> (require '[zero-one.geni.core.dataset-creation :as g] :reload) nil user=> (g/->schema {:coords [{:x :int :y :int}]}) Execution error (IllegalArgumentException) at org.apache.spark.sql.types.DataTypes/createArrayType (DataTypes.java:114). elementType should not be null.
user=> (g/->schema {:coords [{:x :int :y :int}]}) #object[org.apache.spark.sql.types.StructType 0x5cb6297e "StructType(StructField(coords,ArrayType(StructType(StructField(x,IntegerType,true), StructField(y,IntegerType,true)),true),true))"]
At the moment, array-type supports only simple val-type listed in data-type->spark-type. E.g. :bool, :string.
array-type
val-type
data-type->spark-type
:bool
:string
We can extend array-type to support any Spark SQL DataType, in the same fashion we are already doing in struct-field.
DataType
struct-field
Please help reviewing pull request #334
make ci is passing on my machine
make ci
Info
Geni Version: 0.0.38
Problem / Steps to reproduce
Expected results
Proposed solution
At the moment,
array-type
supports only simpleval-type
listed indata-type->spark-type
. E.g.:bool
,:string
.We can extend
array-type
to support any Spark SQLDataType
, in the same fashion we are already doing instruct-field
.