LIMIT arguments are flipped/reversed (compared to doc)

The arguments to the LIMIT clause appeared to be flipped/reversed in SQL compared to the description in the Basic Query page of the documentation.

That page says the first argument is similar to the size parameter in Elasticsearch and the second argument is similar to the from parameter. Therefore, they should indicate how many records are returned and the “starting” record, respectively. If you only specify one argument, it works as described. However, if you specify both arguments, the first is used as the from parameter and the second is used for the size parameter.

This can be clearly seen by looking at the JSON in the Translation window, as shown in this screenshot


Notice that the first arg in the LIMIT clause is “401” and is being mapped to the FROM item in the JSON translation while the second arg (1) is being mapped to SIZE.

When only one arg is provided, it is properly mapped to the SIZE parameter and FROM is set to 0.

I assume this is a bug in the SQL==>Elasticsearch translation although, I suppose, it could be a documentation bug.

@daichen I just looked at the LIMIT section of Basic Query chapter of the reference manual, and it says “Offset position can be given as first argument to indicate where to start fetching.” This matches what I’m seeing in the plug-in but does not match the documentation; so I guess this is a documentation bug. Correct?

Thanks for report! Will check.

Hi @GSmith, from what I see, the Basic Query doc is now like “If you pass in two arguments, the first is mapped to the from parameter and the second to the size parameter in Elasticsearch.” I assume the issue is already fixed?

@daichen Yes, it looks like it was fixed in (ODFE Docs) Pull Request #239.