I'm trying to use a inherited Scala function ( StuctType.diff() ) and im getting a NoSuchMethodError .
public StructType foo(DataFrame df){ StructField sf = this.schema.diff(df.schema()).last(); StructType schema_tmp = new StructType().add(sf); return schema_tmp; }
Someone has any ideas? I'm using Spark 1.6.2 and Scala 2.10
Well I'm using Spark 2.0 and StructType method is supported.Please have a look at the code snippet below I hope its helpful :
val schema = new StructType(Array(
StructField("STORE_ID", StringType,true),
StructField("SALE_DATE", DateType,true)))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.