`NULL` `TIMESTAMP` values are getting interpreted ...
# troubleshooting
m
NULL
TIMESTAMP
values are getting interpreted as
1970-01-01 00:00:00.0
This is my schema –
Copy code
{
  "schemaName": "debug_null_timestamps",
  "enableColumnBasedNullHandling": true,
  "dateTimeFieldSpecs": [
    {
      "name": "created_at",
      "dataType": "TIMESTAMP",
      "fieldType": "DATE_TIME",
      "notNull": false,
      "format": "TIMESTAMP",
      "granularity": "1:MILLISECONDS"
    },
    {
      "name": "updated_at",
      "dataType": "TIMESTAMP",
      "fieldType": "DATE_TIME",
      "notNull": false,
      "format": "TIMESTAMP",
      "granularity": "1:MILLISECONDS"
    }
  ]
}
I have explicitly declared both fields as nullable. I am writing data to a Kafka topic in Avro format with both columns having null values. I have verified this by deserializing this data from another consumer. In my realtime table,
created_at
is the primary key column. Null
created_at
values are being interpreted as
NOW()
(which is fine and understandable), however, null values of
updated_at
are taking the value of
1970-01-01 00:00:00.0
, which I think is basically
Integer.MIN_VALUE
. I am also seeing no errors in the server logs. Here's the Avro schema as well –
Copy code
{
  "type": "record",
  "name": "value",
  "fields": [
    {
      "name": "created_at",
      "type": [
        {
          "type": "long",
          "logicalType": "timestamp-millis"
        },
        "null"
      ]
    },
    {
      "name": "updated_at",
      "type": [
        {
          "type": "long",
          "logicalType": "timestamp-millis"
        },
        "null"
      ]
    }
  ]
}
m
It is not Integer.MIN_VALUE, it is start of epoch. If you want to store as NULL, then you need to enable this: https://docs.pinot.apache.org/developers/advanced/null-value-support
Or you can specify default null value of your choice in the schema.
m
But I have already enabled
"enableColumnBasedNullHandling": true
and also declared the columns as
"notNull": false
r
Can you check the table config also:
"nullHandlingEnabled": true
m
Yes, null handling is also enabled in the table config. UPDATE: Needed to set
enableNullHandling=true
at the beginning of the query.