Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit 99c213d

Browse files
authored
Update lambda.py
1 parent 4a3cd12 commit 99c213d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lambda/lambda.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import os
21
import json
32
import chdb
4-
3+
54
def lambda_handler(event, context):
6-
json_region = os.environ['AWS_REGION']
75
query = event['query'] or "SELECT version()"
86
format = event['default_format'] or "JSONCompact"
97
res = chdb.query(query, format)
8+
out = json.loads(res.data())
109
return {
1110
"statusCode": 200,
1211
"headers": {
1312
"Content-Type": "application/json"
1413
},
15-
"body": json.dumps(res.get_memview().tobytes())
14+
"body": json.dumps(out)
1615
}

0 commit comments

Comments
 (0)