Skip to content

nextUri should be parsed instead of being consumed directly #100

@shawnzhu

Description

@shawnzhu

What happend

When accessing presto behind a HTTPS proxy, this python sdk won't work when trying to following up the nextUri from query statement. E.g., after creating a query, when following statement:

$ curl -k https://192.168.86.20:31947/v1/statement/queued/20200731_194504_00002_azxv3/y61f7c68358f1460750b1f4fca89c4b272c55d0b3/1
{"id":"20200731_194504_00002_azxv3","infoUri":"http://192.168.86.20:8080/ui/query.html?20200731_194504_00002_azxv3","nextUri":"http://192.168.86.20:8080/v1/statement/executing/20200731_194504_00002_azxv3/ya4b5bce0c6391da9d771a40df96d4723d2280b81/0","stats":{"state":"QUEUED","queued":true,"scheduled":false,"nodes":0,"totalSplits":0,"queuedSplits":0,"runningSplits":0,"completedSplits":0,"cpuTimeMillis":0,"wallTimeMillis":0,"queuedTimeMillis":29,"elapsedTimeMillis":381605,"processedRows":0,"processedBytes":0,"peakMemoryBytes":0,"spilledBytes":0},"warnings":[]}

Notice that the nextUri does not starts with HTTPS.

As a consequence, the python client will fail since it tries to use the value of this nextUri directly:

@property
def next_uri(self):
# type: () -> Text
return self._next_uri

Expected outcome

It should parse the value of nextUri then format it just like that for the statement url.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions