This is an automated email from the ASF dual-hosted git repository. dzamo pushed a commit to branch 1.20 in repository https://gitbox.apache.org/repos/asf/drill.git
commit 8e2bf91879e9b105d7f8fc637f0585b9aacf3bd8 Author: Charles S. Givre <[email protected]> AuthorDate: Mon Dec 5 07:32:55 2022 -0500 DRILL-8365: HTTP Plugin Places Parameters in Wrong Place (#2715) --- .../org/apache/drill/exec/store/http/HttpBatchReader.java | 4 ++-- .../apache/drill/exec/store/http/HttpScanBatchCreator.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpBatchReader.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpBatchReader.java index 8bbe855626..697b569f10 100644 --- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpBatchReader.java +++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpBatchReader.java @@ -189,8 +189,8 @@ public class HttpBatchReader implements ManagedReader<SchemaNegotiator> { logger.debug("Building URL from {}", baseUrl); HttpApiConfig apiConfig = subScan.tableSpec().connectionConfig(); - // Append table name, if available. - if (subScan.tableSpec().tableName() != null) { + // Append table name, if present. When pagination is used, the paginator adds this. + if (subScan.tableSpec().tableName() != null && paginator == null) { baseUrl += subScan.tableSpec().tableName(); } diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpScanBatchCreator.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpScanBatchCreator.java index 3bdee3f242..d4d7a579ce 100644 --- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpScanBatchCreator.java +++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpScanBatchCreator.java @@ -112,7 +112,16 @@ public class HttpScanBatchCreator implements BatchCreator<HttpSubScan> { private Paginator getPaginator() { HttpUrl.Builder urlBuilder; - HttpUrl rawUrl = HttpUrl.parse(subScan.tableSpec().connectionConfig().url()); + HttpUrl rawUrl; + + // Append table name, if present. + if (subScan.tableSpec().tableName() != null) { + rawUrl = HttpUrl.parse(subScan.tableSpec().connectionConfig().url() + subScan.tableSpec().tableName()); + } else { + rawUrl = HttpUrl.parse(subScan.tableSpec().connectionConfig().url()); + } + + // If the URL is not parsable or otherwise invalid if (rawUrl == null) {
