Is there way to rename the column names in dataset using Jackson annotations while creating a Dataset?
My encoder class is as follows:
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import scala.Serializable;
import javax.persistence.Table;
@Builder
@Data
@AllArgsConstructor
@EqualsAndHashCode
@Table(name = "sample_table")
public class SampleRecord implements Serializable {
@JsonProperty("sample_id")
private Long sampleId;
@JsonProperty("sample_name")
private String name;
@JsonProperty("sample_desc")
private String description;
}
My aim is to rename the columns according to the @JsonProperty, so that I can re-use the same class and json functionality.
Please find related versions of modules: - Spark : 2.4.0 (with scala 2.11) - jackson-module-scala_2.11 : 2.9.6
Let me know if you need more information. Help appreciated.