schema = StructType([
StructField("title", StringType(), False),
StructField("stringdataA", StringType(), False),
# StructField("list", ArrayType( StructType([
# StructField("A", IntegerType() , False),
# StructField("B", StringType() , False),
# StructField("C", TimestampType(), False)
# ]))),
StructField("stringdataB", StringType(), False)])
@pandas_udf(schema, PandasUDFType.GROUPED_MAP)
def make_data(x):
~~ make data fitted in shcema
groupedList = df.groupby("groupkey").apply(make_data)
'make_data' function will make data which is fitted in a schema I defined, but when I added list( map()) structure field in schema. It gave me a error like below. Is that really not supported schema structure?
Is there any way to get list( map()) structure data that I can handle?
NotImplementedError: Invalid returnType with grouped map Pandas UDFs: StructType(List(StructField(title,StringType,false),StructField(stringdataA,StringType,false),StructField(list,ArrayType(StructType(List(StructField(A,IntegerType,false),StructField(B,StringType,false),StructField(C,TimestampType,false))),true),true),StructField(stringdataB,StringType,false))) is not supported