abhishekagarwal87 commented on issue #9591:
URL: https://github.com/apache/druid/issues/9591#issuecomment-671568034


   There is likely another bug though. When transformSpec is moved from Parser 
to dataSchema, the transformations are applied twice. 
   Once in InputSourceProcessor
   ```
   final InputSourceReader inputSourceReader = 
dataSchema.getTransformSpec().decorate(
           inputSource.reader(
               new InputRowSchema(
                   dataSchema.getTimestampSpec(),
                   dataSchema.getDimensionsSpec(),
                   metricsNames
               ),
               inputFormat,
               tmpDir
           )
       );
   ```
   and other in DataSchema#getParser()
   ```
   inputRowParser = 
transformSpec.decorate(objectMapper.convertValue(this.parserMap, 
InputRowParser.class));
   ```
   
   Test query fails if I move the transformSpec out
   ExpectedOutput: 
   ```
   {
     "version": "v1",
     "timestamp": "2013-08-31T00:00:00.000Z",
     "event": {
       "added_count_times_ten": 27160,
       "newPage": "Crimson Typhoon",
       "city": "city-Taiyuan",
       "double_deleted_count": 10,
       "delta_overshadowed": 450,
       "added_count": 2716
     }
   }
   ```
   Actual output
   ```
   {
     "version": "v1",
     "timestamp": "2013-08-31T00:00:00.000Z",
     "event": {
       "double_deleted_count": 10,
       "delta_overshadowed": 225,
       "city": "city-city-Taiyuan",
       "newPage": "Crimson Typhoon",
       "added_count_times_ten": 27160,
       "added_count": 2716
     }
   }
   ```
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to