In JDBC input plugin, pagination works by enclosing the given source query as a sub query and the applying the offset and limit to the query.
The count query also works in the same way.
The problem arises when the query contains a CTE. According to SQL server documentation CTE or with clause must be the first clause in the query.
The table from which we are indexing contains approximately 20 million records.
Is there a workaround for this problem is logstash or should we move to alternate methods to index data? What is the best possible solution for this problem.