@All - how to write schema for date column I have ...
# general
r
@All - how to write schema for date column I have a column with date: "startDate": "2021-01-04 000000" Need help 🙂
x
Can you try something like :
"dateTimeFieldSpecs": [{ "name": "startDate", "dataType": "STRING", "format" : "1SECONDSSIMPLE_DATE_FORMAT:yyyy-MM-dd HHmmss", "granularity": "1:DAYS" }]
1
r
Thanks, I have two fields startDate and endDate then. I have to write two times this block of code with name different. am I right?
I have three date columns, So, I written like this,
Copy code
"dateTimeFieldSpecs": [
  {
    "name": "_source.startDate",
    "dataType": "STRING",
    "format": "1:SECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd",
    "granularity": "1:DAYS"
  },
  {
    "name": "_source.lastUpdate",
    "dataType": "STRING",
    "format": "1:SECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss",
    "granularity": "1:DAYS"
  },
  {
    "name": "_source.sDate",
    "dataType": "STRING",
    "format": "1:SECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss",
    "granularity": "1:DAYS"
  }
]
can you please correct. I am getting error {"code":400,"error":"Cannot find valid fieldSpec for timeColumn: timestamp from the table config: eventflow_REALTIME, in the schema: eventflowstats"}
Hi Xiang Fu, can you check once