This message was deleted.
# general
s
This message was deleted.
b
Can you attach the spec?
e
Copy code
}
          ]
        }
      },
      "useEarliestOffset": true
    },
    "tuningConfig": {
      "type": "kafka"
    },
    "dataSchema": {
      "dataSource": "enviro_forecast_table",
      "timestampSpec": {
        "column": "payload.after.timeSec",
        "format": "posix"
      },
      "transformSpec": {
        "transforms": [
          {
            "type": "expression",
            "name": "timeSec",
            "expression": "__time"
          }
        ]
      },
      "granularitySpec": {
        "queryGranularity": "minute",
        "rollup": false,
        "segmentGranularity": "hour"
      },
      "dimensionsSpec": {
        "useSchemaDiscovery": true,
        "dimensionExclusions": []
      }
    }
  }
}
@Ben Krug i added the timeSec columns during the ingestion by extracting the values from the __time expression. When publishing the task i can see the column defined in the transformspec.transforms.type but for somereason it does not appear in my table
b
I'm having trouble testing atm, but I tried two things - one to just copy the timestamp, which will give you a number (milliseconds since epoch iirc), or using timestamp_format to get a string with the date & time. I got this syntax:
{ "type": "expression", "name": "time_plain", "expression": "\"__time\"" }, { "type": "expression", "name": "time_format", "expression": "timestamp_format(\"__time\")" }
e
@Ben Krug that is also similar to yours what I did but the issue is when i create the new column time_plain for example copy the values using the expression __time and reach the apply the configure schema , the new created column gets deleted even though it appears in my json spec just like you have it above. Somehow druid is seeing it as a duplicate column (but with a different name ) and removing it
s
Have you tried just adding the source field in the dimensions list, in addition to its mapping in the timestampSpec?
b
@El Hakan if that doesn't work, please post the entire spec and we can see if there's anything else that's affecting it.
k
Hello. It's very simple. what ever is the column name, Please click on Transform button and add column option and give the exact column name which is already there then click ok then you can find your old time column.