AI Search Indexer started failing with opperand type clash error
Starting 26 Feb 2025 at around 2 PM EET, indexers on our Azure AI Search services started failing on all our environments at around the same time. The indexers have previously worked with no other issue. The error is Operand type clash: datetime2 is incompatible with timestamp.
We currently use a column named HighWatermark as the HighWatermark column with the SQL data type datetime2. In the c# indexer code, we have defined the model type used for the HighWatermark as Datetime (we have also tried to change it now to DateTimeOffset with no success).
[SimpleField(IsKey = true)]
public string DocumentKey { get; set; }
[SimpleField(IsFilterable = true)]
public int Id { get; set; }
[SimpleField(IsFilterable = true, IsFacetable = true)]
public int Type { get; set; }
[SimpleField(IsHidden = true)]
public DateTime HighWatermark { get; set; }
[SimpleField(IsFilterable = true, IsFacetable = true)]
public DateTimeOffset ModifiedDate { get; set; }
[...]
The first time when the indexer runs it seems to work successfully. But for later runs it always crashes with the mentioned error
This is the configuration for the AI Search Instance:
{
"@odata.context": "...",
"@odata.etag": "",
"name": "...",
"description": null,
"type": "azuresql",
"subtype": null,
"credentials": {
"connectionString": "..."
},
"container": {
"name": "db_view",
"query": null
},
"dataChangeDetectionPolicy": {
"@odata.type": "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy",
"highWaterMarkColumnName": "HighWatermark"
},
"dataDeletionDetectionPolicy": {
"@odata.type": "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy",
"softDeleteColumnName": "IsDeleted",
"softDeleteMarkerValue": "true"
},
"encryptionKey": null,
"identity": null
}
The HighWatermark is computed in DB view as
GREATEST(
i1.[ModifiedDate],
i1.[DeletedDate],
i2.[ModifiedDate],
i2.[DeletedDate],
i3.[SettingsModifiedDate])
)
All of the columns are of type Datetime2(7).