-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart_join.py
More file actions
31 lines (26 loc) · 1.01 KB
/
start_join.py
File metadata and controls
31 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import requests
import json
from datasources import ds_csv_1
result = requests.post('http://localhost:8080/simjoin/api/addsource',
data=json.dumps(ds_csv_1),
headers={'Content-Type':'application/json',
'accept': 'application/json'})
print(result.json())
api_key = result.headers['id']
ds_id = result.json()[0]['id']
join_json = {
"limit": 50,
"params": {
"input_dataSource": ds_id,
"join_type": "knn",
"k": 2,
"max_lines": 100,
"threshold": 0
}
}
result = requests.post('http://localhost:8080/simjoin/api/startjoin',
data=json.dumps(join_json),
headers={'Content-Type':'application/json',
'accept': 'application/json',
'api_key': api_key})
print(result.json())