Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3630

Remove unused fields in the implementations of MeasureType

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v2.6.0
    • Component/s: None
    • Labels:
      None

      Description

      In code RawMeasureType#RawMeasureType, we can see that both funcName and dataType are use, and this can be remove cuz there's no constraint on its constructor.

          @SuppressWarnings("unused")
          private final DataType dataType;
      
          public RawMeasureType(String funcName, DataType dataType) {
              this.dataType = dataType;
          }
      

      And after we done that, we can more easily test MeasureType without passing in meaningless args(AggregatorMemEstimateTest#112).

      Like codes in org.apache.kylin.measure.dim.DimCountDistinctMeasureType, other implementations can be cleaner.

              @Override
              public MeasureType<Object> createMeasureType(String funcName, DataType dataType) {
                  return new DimCountDistinctMeasureType();
              }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Aron.tao Jiatao Tao
                Reporter:
                Aron.tao Jiatao Tao
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: