Github user BJangir commented on the issue: https://github.com/apache/carbondata/pull/1861 @xubo245 , if agg table is already created and create datamap command is fired again with "if not exists" syntax then processMetadata will not return any Error (as expected ) but then processData will be triggered and processData will throw error because createPreAggregateTableCommands is not initialized . So "table exists" check need to handle in processData also . Steps to reproduce 1. Create table maintable 2. load data maintable 3. Create datamap map1 on table maintable 4. Create datamap if not exists map1 on table maintable
---