Skip to content

Commit

Permalink
Merge pull request #2582 from kuzudb/issue-2572
Browse files Browse the repository at this point in the history
Fix issue 2572
  • Loading branch information
andyfengHKU committed Dec 14, 2023
2 parents 2af6412 + 05dbed2 commit 15ac0e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/transform/transform_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ std::unique_ptr<ParsedExpression> Transformer::transformStructLiteral(
for (auto& structField : ctx.kU_StructField()) {
auto structExpr = transformExpression(*structField->oC_Expression());
std::string alias;
if (structField->oC_Expression()) {
if (structField->oC_SymbolicName()) {
alias = transformSymbolicName(*structField->oC_SymbolicName());
} else {
alias = transformStringLiteral(*structField->StringLiteral());
Expand Down
4 changes: 4 additions & 0 deletions test/test_files/tinysnb/function/struct.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
---- 1
{a: 1, b: {c: C, d: D}}

-STATEMENT RETURN {"foo": "bar"};
---- 1
{foo: bar}

-LOG StructExtract
-STATEMENT WITH {a:1, b:{c: 'C', d: 'D'}} AS s RETURN s.b.c
---- 1
Expand Down

0 comments on commit 15ac0e3

Please sign in to comment.