logstash-plugins / logstash-filter-jdbc_static

Loads a DB query's result set in memory and uses it as lookup table for events.
Apache License 2.0
11 stars 12 forks source link

If Sequel does not have a specific adapter, the count query that is built can be wrong. #29

Open guyboertje opened 6 years ago

guyboertje commented 6 years ago

Add a new setting in the loader settings count_query to allow the user to supply a syntactically correct one. Although this allows the user to bypass any max_record checks I think it can be useful.

guyboertje commented 6 years ago

Alternative: In register or run (i.e. after a connection is viable), try the count query, rescue the error and bypass any max rows checks?

buinauskas commented 5 years ago

Seconding that. Plugin has generated the following query in my case:

SELECT count(*) AS "COUNT" FROM (SELECT categoryId, countryId, brandId, supplierId FROM UNNEST ((SELECT filters FROM migration_search.categories WHERE categoryid=207420))) AS "T1" LIMIT 1

And my driver does not support this syntax - therefore I get an error

sgums commented 3 years ago

Informix doesn't support this either. Some form of bypass would be greatly appreciated.

ikus060 commented 3 years ago

Bumping this too. I don't understand why the plugin need to count the number of record.

Mahfoud047 commented 2 years ago

Any updates on this, I have an error too, with Teradata database because of the keyword LIMIT, issue: https://github.com/logstash-plugins/logstash-filter-jdbc_static/issues/62

@guyboertje could you confirm wheather the setting count_query has been added or not and if you can give an example on how to use it please, thanks in advance.