Class RenameFields


  • @Experimental(SCHEMAS)
    public class RenameFields
    extends java.lang.Object
    A transform for renaming fields inside an existing schema. Top level or nested fields can be renamed. When renaming a nested field, the nested prefix does not need to be specified again when specifying the new name.

    Example use:

    PCollection<Event> events = readEvents();
     PCollection<Row> renamedEvents =
       events.apply(RenameFields.<Event>create()
           .rename("userName", "userId")
           .rename("location.country", "countryCode"));
     
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RenameFields.Inner<T>
      The class implementing the actual PTransform.
    • Constructor Summary

      Constructors 
      Constructor Description
      RenameFields()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> RenameFields.Inner<T> create()
      Create an instance of this transform.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RenameFields

        public RenameFields()
    • Method Detail

      • create

        public static <T> RenameFields.Inner<T> create()
        Create an instance of this transform.