In my testing it seems that JDBC river is caching the subquery in my
statement. Below is the river I'm testing with:
{
"type" : "jdbc",
"jdbc" : {
"strategy" : "simple",
"poll" : "5s",
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://127.0.0.1:6033/test",
"user" : "user",
"password" : "password",
"sql" : "SELECT orders
.id
AS _id
, orders
.name
,
orders
.description
, BinaryToGuid(orders
.guid
), orders
.number
,
orders
.date
FROM test
.orders
WHERE orders
.date
> (SELECT
orders_meta
.last_run
FROM test
.orders_meta
);",
"acksql" : "UPDATE test
.orders_meta
SET last_run
= UTC_TIMESTAMP()
WHERE id
= 1;"
},
"index" : {
"index" : "orders",
"type" : "order"
}
}
The poll gets 7 items which is fine on the first run. Subsequent runs
should get 0 since there are no new items. But they get 7 items again
which tells me that it's using the same last_run
it selected the first
time.
Any thoughts on how to correct this? I was looking through the source of
JDBC river, but I'm not that familiar with Java (though I understand what I
see).
Justin
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ef5cb3fa-fb87-430e-8a35-82680a3a71c0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.