Unable perform incremental selection operation using $metrics.lastexecutionstart in Sql Server


(V.S.REDDY) #1

Unable perform incremental selection operation using $metrics.lastexecutionstart in Sql Server.

My code:
PUT /_river/file_river/_meta
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:sqlserver://localhost;databaseName=AdventureWorks2008R2",
"user" : "",
"password" : "",
"sql" : [
{
"statement" : " SELECT TOP 1000 ShipMethod.ShipMethodID,ShipMethod.ShipRate,ShipMethod.ModifiedDate,ShipMethod.ShipBase,ShipMethod.rowguid,ShipMethod.Name FROM ShipMethod where ShipMethod.ModifiedDate > ?",
"parameter" : ["$metrics.lastexecutionstart"]
}
],
"index" : "file",
"type" : "file_stat",
"schedule": "0/5 0-59 * * * ?"
}
}

ShipMethod.ModifiedDate format is : '2008-03-11 10:01:36.827'

Elasticsearch throws an exception saying below exception.

Error Logs:

[2015-08-28 10:24:35,227][ERROR][river.jdbc.RiverPipeline ] com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting date and/or time from character string.
java.io.IOException: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting date and/or time from character string.
at

But am able to perform same operation in My Sql successfully.


How to find out $metrics.lastexecutionstart value
(system) #2