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

[Feature Request]: HTTP API support #779

Closed
23 tasks done
JinHai-CN opened this issue Mar 14, 2024 · 5 comments
Closed
23 tasks done

[Feature Request]: HTTP API support #779

JinHai-CN opened this issue Mar 14, 2024 · 5 comments
Assignees
Labels
feature request New feature or request

Comments

@JinHai-CN
Copy link
Contributor

JinHai-CN commented Mar 14, 2024

Describe the feature you'd like

Infinity needs HTTP API to support, detailed API design, please follow HTTP API

@JinHai-CN JinHai-CN added the feature request New feature or request label Mar 14, 2024
@JinHai-CN
Copy link
Contributor Author

JinHai-CN commented Mar 15, 2024

#770 List databases

@JinHai-CN
Copy link
Contributor Author

Duplicated with #786

@Thomas134
Copy link
Contributor

Drop table/Show variables

JinHai-CN pushed a commit that referenced this issue Mar 18, 2024
### What problem does this PR solve?
Add http service API
- [x] Create database
- [x] Drop database

Issue link: #779 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: chrysanthemum-boy <fannc@qq.com>
@morphes1995
Copy link
Contributor

I want try to implement Create index/Drop index/ Show index

JinHai-CN pushed a commit that referenced this issue Mar 19, 2024
### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

Add http service API
 - [x]  List indexes of a specified table

eg: curl --request GET --url localhost:23820/indexes/default/test_index
--header 'accept: application/json', and the result :
```
{
    "error_code": 0,    
    "db_name": "default",
    "table_name": "test_index",
    
    "indexes": [
        {
            "column_id": "0",
            "column_name": "col1",
            "index segments": "0/0",
            "index_name": "idx1",
            "index_type": "IVFFlat",
            "other_parameters": "metric = l2, centroids_count = 128",
            "path": "/tmp/infinity/data/97PHM4Cobx_db_default/xT2aqC2SQ3_table_test_index/eVINACIkLj_index_idx1"
        },
        {
            "column_id": "0",
            "column_name": "col1",
            "index segments": "0/0",
            "index_name": "idx2",
            "index_type": "HNSW",
            "other_parameters": "metric = l2, encode_type = plain, M = 16, ef_construction = 50, ef = 50",
            "path": "/tmp/infinity/data/97PHM4Cobx_db_default/xT2aqC2SQ3_table_test_index/TTOELZEonq_index_idx2"
        }
    ]
}
``` 

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)


Signed-off-by: morphes1995 <morphes1995@gmail.com>
JinHai-CN pushed a commit that referenced this issue Mar 19, 2024
### What problem does this PR solve?

Add HTTP API service of Create table and Drop table.
- [x] Create table
- [x] Drop table

Issue link:#779 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: chrysanthemum-boy <fannc@qq.com>
@Thomas134 Thomas134 mentioned this issue Mar 20, 2024
9 tasks
JinHai-CN pushed a commit that referenced this issue Mar 20, 2024
### What problem does this PR solve?
-[x] Show variable.

eg. curl --request GET \
     --url localhost:23820/variables/time_zone \
     --header 'accept: application/json'
`{"error_code":0,"variable_name":"time_zone","variable_value":"UTC-8"}`

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
JinHai-CN pushed a commit that referenced this issue Mar 20, 2024
### What problem does this PR solve?

Update HTTP API service, add a function test for show database.
- [x] Show table
- [x] List table

Issue link:#829 #779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Test cases

---------

Co-authored-by: chrysanthemum-boy <fannc@qq.com>
@JinHai-CN JinHai-CN mentioned this issue Mar 21, 2024
79 tasks
JinHai-CN pushed a commit that referenced this issue Mar 22, 2024
### What problem does this PR solve?

Add extra information in show output data structure

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)


Signed-off-by: morphes1995 <morphes1995@gmail.com>
@JinHai-CN JinHai-CN mentioned this issue Mar 22, 2024
1 task
JinHai-CN pushed a commit that referenced this issue Mar 23, 2024
### What problem does this PR solve?

HTTP API: create index and drop index

- [x]  Create index
- [x]  Drop index

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: morphes1995 <morphes1995@gmail.com>
JinHai-CN added a commit that referenced this issue Mar 23, 2024
### What problem does this PR solve?

Add HTTP API: Delete
```
infiniflow=> select * from t1;
 c1 
----
  3
  5
  3
  5
  3
  5
(6 rows)
```

```
curl --request DELETE --url localhost:23820/databases/default/tables/t1/docs --header 'accept: application/json' --header 'content-type: application/json' --data '    
{                                
    "filter": "c1  = 3"
} '
{"delete_row_count":3,"error_code":0}
```

```
infiniflow=> select * from t1;
 c1 
----
  5
  5
  5
(3 rows)
```


Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
@JinHai-CN JinHai-CN mentioned this issue Mar 23, 2024
1 task
JinHai-CN added a commit that referenced this issue Mar 23, 2024
### What problem does this PR solve?

```
infiniflow=> select * from t1;
 c1 | c2 
----+----
  2 |  2
  3 |  3
  4 |  4
  5 |  5
```

```
curl --request PUT --url localhost:23820/databases/default/tables/t1/docs --header 'accept: application/json' --header 'content-type: application/json' --data '    
{
    "update": { "c2": 5 }, "filter": "c1  = 3"
} '
```

```
infiniflow=> select * from t1;
 c1 | c2 
----+----
  2 |  2
  4 |  4
  5 |  5
  3 |  5
(4 rows)

```

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
@JinHai-CN JinHai-CN mentioned this issue Mar 24, 2024
1 task
JinHai-CN added a commit that referenced this issue Mar 25, 2024
### What problem does this PR solve?

1. Filter, output, knn is OK. But output vector and match doens't work.
2. Fix hello_infinity.py

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
JinHai-CN added a commit that referenced this issue Mar 25, 2024
### What problem does this PR solve?

```
curl --request GET --url localhost:23820/databases/default/tables/my_table/docs --header 'accept: application/json' --header 'content-type: application/json' --data '
{
    "output":
    [
        "num",
        "body",
        "vec"
    ],
    "fusion": 
    {
        "method": "rrf",
        "match":
        {
            "fields": "body", 
            "query": "bloom",
            "operator": "topn=3"
        },
        "knn":
        {
            "fields": "vec",
            "query_vector": [3.0, 2.8, 2.7, 3.1],
            "element_type": "float",
            "top_k": 3,
            "metric_type": "inner_product"
        }
    }
} '
```

```
{
"error_code":0,
"output":[{"body":"Office for Harmful Blooms","num":"2","vec":"4.000000, 4.200000, 4.300000, 4.500000"},{"body":"unnecessary and harmful","num":"1","vec":"1.000000, 1.200000, 0.800000, 0.900000"}]
}
```

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
@morphes1995
Copy link
Contributor

morphes1995 commented Mar 26, 2024

I want to implement segment related interfaces. Currently. segments info and single detailed segment info are both provided by ExecuteShowSegments method, which is inflexible to list more segment details. A seperate Implementation (using ExecuteShowSegments and ExecuteShowSegmentDetail ) is better ,i think . And the same goes for block info display. @JinHai-CN

JinHai-CN pushed a commit that referenced this issue Mar 28, 2024
### What problem does this PR solve?

HTTP API: SHOW SEGMENT

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: morphes1995 <morphes1995@gmail.com>
Ma-cat pushed a commit to Ma-cat/infinity that referenced this issue Mar 28, 2024
### What problem does this PR solve?

HTTP API: SHOW SEGMENT

Issue link:infiniflow#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: morphes1995 <morphes1995@gmail.com>
Ma-cat pushed a commit to Ma-cat/infinity that referenced this issue Mar 28, 2024
### What problem does this PR solve?

HTTP API: SHOW SEGMENT

Issue link:infiniflow#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: morphes1995 <morphes1995@gmail.com>
JinHai-CN pushed a commit that referenced this issue Mar 29, 2024
### What problem does this PR solve?

Show specific block of segment

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: morphes1995 <morphes1995@gmail.com>
JinHai-CN pushed a commit that referenced this issue Apr 2, 2024
### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

 - [x] List segments of a table
 - [x] List blocks of a segment

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: morphes1995 <morphes1995@gmail.com>
JinHai-CN added a commit that referenced this issue Apr 11, 2024
### What problem does this PR solve?

HTTP API: Import data


```
curl --request PUT --url localhost:23820/databases/default/tables/t1 --header 'accept: application/json' --header 'content-type: application/json' --data ' 
{
    "file_path":"/tmp/infinity/test_data/pysdk_test_commas.csv",
    "file_type":"csv",
    "header":false,
    "delimiter":","
} '

{"error_code":0}

```

Issue link:#779

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
@JinHai-CN JinHai-CN mentioned this issue Apr 16, 2024
1 task
JinHai-CN pushed a commit that referenced this issue Apr 16, 2024
### What problem does this PR solve?

add http_api_test

Issue link:#779

### Type of change

- [x] Test cases

---------

Co-authored-by: chrysanthemum-boy <fannc@qq.com>
Co-authored-by: chrysanthemum-boy <69421435+chrysanthemum-boy@users.noreply.github.com>
@JinHai-CN JinHai-CN mentioned this issue Apr 22, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants