getmoto / py-partiql-parser

Python Parser for PartiQL
MIT License
7 stars 3 forks source link

Query by object property nested in array, the result is fault #6

Closed lvyan2001 closed 1 year ago

lvyan2001 commented 1 year ago

input_object3 = {"a1": [{"name":"lvyan"}], "a2": "b2"} third_doc = json.dumps(input_object3)

query = "select * from table where a1.name = 'wangyi' " #结果错误 result = DynamoDBStatementParser(source_data={"table": third_doc}).parse( query, parameters=[] ) print(result)

bblommers commented 1 year ago

Hi @lvyan2001, we return an empty result for your query - but so does AWS.

Because a1 is a list, the query should be: select * from table where a1[0].name = 'lvyan'

We do not return any data there, even though we should. Looks like we don't handle lists in a where-clause properly .