Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-5726

FileSetProperties#setDescription returns a Builder which can not set more FileSetProperties

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: API, Datasets
    • Labels:
      None
    • Rank:
      1|hzzbk7:

      Description

      FileSetProperties#setDescription returns a DatasetProperties#Builder.
      Because of this, once you setDescription on a FileSetProperties#builder, you can not call additional FileSetProperty properties.

      A workaround is for the user to call setDescription as the last method call on the builder, or to cast the builder back down to a FileSetProperties#Builder after calling setDescription (or any other methods in the base Builder class).

      For instance:
      You can do

      createDataset("name", FileSet.class, FileSetProperties.builder()
            .setOutputFormat(TextOutputFormat.class)
            .setDescription("desc")
            .build());
      

      but swapping the two method calls results in a compilation error:

      createDataset("name", FileSet.class, FileSetProperties.builder()
            .setDescription("desc")
            .setOutputFormat(TextOutputFormat.class)
            .build());
      

      Likely, this issue exists for other subclasses of DatasetProperties#Builder, such as those in ObjectMappedTableProperties and PartitionedFileSetProperties.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andreas Andreas Neumann
                Reporter:
                ali.anwar Ali Anwar
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: