Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset pagination problem with http storage: parameters being specified more than once #2981

Open
YellowStallion opened this issue Mar 13, 2025 · 1 comment
Assignees
Labels

Comments

@YellowStallion
Copy link

I'm running Drill 1.21.2 on Windows and having problems using the Pagination functionality of the http storage plugin when querying an ODATA source. The $skip and $top parameters are being appended to the URL of each request, so that I see requests like this:

URL: https://services.odata.org/V4/Northwind/Northwind.svc/Customers?%24skip=0&%24top=15&%24skip=15&%24top=15

The %24skip=0&%24top=15 should not be present, only the %24skip=15&%24top=15

To reproduce, create a storage plugin called customers, with this config:

{
"type": "http",
"connections": {
"customers": {
"url": "https://services.odata.org/V4/Northwind/Northwind.svc/Customers",
"requireTail": false,
"method": "GET",
"dataPath": "value",
"authType": "none",
"inputType": "json",
"xmlDataLevel": 1,
"postParameterLocation": "QUERY_STRING",
"verifySSLCert": true,
"paginator": {
"limitParam": "$top",
"offsetParam": "$skip",
"pageSize": 15,
"method": "OFFSET"
}
}
},
"retryDelay": 1000,
"proxyType": "direct",
"authMode": "SHARED_USER",
"enabled": true
}

Then run this query:

select * from customers.customers;

This is the error I'm seeing:

org.apache.drill.common.exceptions.UserRemoteException: DATA_READ ERROR: Error parsing JSON - Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number (or 'NaN'/'+INF'/'-INF'), Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 2]

Syntax error
Connection: customers
Plugin: customers
URL: https://services.odata.org/V4/Northwind/Northwind.svc/Customers?%24skip=0&%24top=15&%24skip=15&%24top=15
Fragment: 0:0

@cgivre
Copy link
Contributor

cgivre commented Mar 13, 2025

Thanks for reporting this. I'll take a look.

@cgivre cgivre self-assigned this Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants