# Elastic Search Incremental River always fetching data

**URL:** <https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877>\
**Category:** Elasticsearch\
**Created:** [May 12, 2016, 9:40am UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877 "2016-05-12T09:40:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)\
**Post date:** [May 12, 2016, 9:40am UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877/1 "2016-05-12T09:40:44Z")

</div>

We are currently using ES 1.4. We are using incremental river to fetch delta change from DB.  
We are using the below query:

```
{
	"type": "jdbc",
	"jdbc": {
		"url": null,
		"user": "userName",
		"password": "pwd",
		"sql": {
			"statement": "select * from table where SYS_EXTRACT_UTC(column1) >= ? OR SYS_EXTRACT_UTC(column2) >= ?"
		},
		"parameter": ["$river.state.last_active_begin",
			"$river.state.last_active_begin"
		],
		"index": "indexName"
	},
	"schedule": "0 */1 * ? * * *"
}

```

When we are looking in ES logs we are seeing the rows returned are always greater than 0 even though no changes are made in either " **column1**" or " **column2**".

Also can we use column strategy in this case.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 12, 2016, 10:13am UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877/2 "2016-05-12T10:13:08Z")

</div>

Thank you for asking for help on my community plugin (JDBC river).

You can also open an issue at

> **[jprante/elasticsearch-jdbc](https://github.com/jprante/elasticsearch-jdbc/issues/)**
>
> elasticsearch-jdbc - JDBC importer for Elasticsearch

Rivers are no longer maintained, and I urgently ask you to update to a more recent Elasticsearch version and use a different JDBC import tool, e.g. the JDBC importer (which is the successor of the outdated river implementation, but runs in a separate Java VM).

---

<div class="post-metadata">

**Author:** ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)\
**Post date:** [May 12, 2016, 10:25am UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877/3 "2016-05-12T10:25:07Z")

</div>

> [@jprante](#):
>
> ers are no longer maintained, and I urgently ask you to update to a more recent Elasticsearch version and use a different JDBC import tool, e.g. the JDBC importer (which is the successor of the outdated river implementation, but runs in a separate Java VM).

Thanks for your response. Updating ES version is not an immediate option for us. We are trying to find out what must be causing the issue.  
Any help or reference would be of great help.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 12, 2016, 10:56am UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877/4 "2016-05-12T10:56:03Z")

</div>

There are many inconsistencies/bugs in JDBC river, and the handling of parameter like `$river.state.last_active_begin` is one of them, fixed later in JDBC importer.

---

<div class="post-metadata">

**Author:** ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)\
**Post date:** [May 13, 2016, 5:04am UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877/5 "2016-05-13T05:04:58Z")

</div>

We have multiple types in our Index and each type has its own incremental river. For some we are getting 0 rows when incremental river runs but for some of the other types, few rows are always being returned even if no changes were made.  
We are not able to find out why we are having this inconsistency.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:51pm UTC](https://discuss.elastic.co/t/elastic-search-incremental-river-always-fetching-data/49877/6 "2017-07-05T22:51:55Z")

</div>


