Re: Lost names of struct fields in UDF
Hi. It's surprisingly, but this code solves my problem: private static Column namedStruct(Column... cols) { List<_expression_> exprs = Arrays.stream(cols) .flatMap(c -> Stream.of( new Literal(UTF8String.fromString(((NamedExpression) c.expr()).name()), DataTypes.S
Lost names of struct fields in UDF
Hi everybody! This code: DataFrame df = sqlContext.read().json(FILE_NAME); DataFrame profiles = df.select( column("_id"), struct( column("name.first").as("first_name"), column("name.last").as("last_name"), column("friends") ).as("pro