Skip to content

Conversation

@phuhung273
Copy link
Contributor

@phuhung273 phuhung273 commented Oct 23, 2025

Issue # (if applicable)

Close #35403

Reason for this change

  • Incorrect template when using StateMachine JSONPath with DistributedMap's ResultWriter with JSONata
  • Streamline JSONata migration. Without this fix, the only workaround is switching entire StateMachine to JSONata, requiring too much change.

Description of changes

  • DistributedMap add query language validation
  • DistributedMap ResultWriter correct query language selection

Description of how you validated changes

Unit + Integ

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team October 23, 2025 21:39
@github-actions github-actions bot added p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Oct 23, 2025
@phuhung273 phuhung273 force-pushed the distributed-map-query-lang branch from 730579a to 41b4aaf Compare October 23, 2025 21:46
@phuhung273 phuhung273 mentioned this pull request Oct 28, 2025
1 task
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p1 and removed p2 labels Oct 30, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 30, 2025
@kumvprat kumvprat self-assigned this Oct 31, 2025
Copy link
Contributor

@kumvprat kumvprat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

Added a few inline comments

Can you also give me context into the feature flag being used in the test ?
Overall we should test with and without the feature flag being set and check for proper query language setting .

// GIVEN
const stack = new cdk.Stack();

stack.node.setContext(STEPFUNCTIONS_USE_DISTRIBUTED_MAP_RESULT_WRITER_V2, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we need to set explicitly ?

What about the case where this feature flag is false ? We need to add tests for that use case as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a defect of getResultWriter function

private getResultWriter(): ResultWriterV2 | ResultWriter | undefined {
return FeatureFlags.of(this).isEnabled(STEPFUNCTIONS_USE_DISTRIBUTED_MAP_RESULT_WRITER_V2)
? this.resultWriterV2
: this.resultWriter;
}

Currently, to use resultWriterV2 we need 2 steps:

  1. Set the flag to true
  2. Specify param resultWriterV2: new stepfunctions.ResultWriterV2

I think only step 2 should be enough. But won't change this logic for now.

My intention when first submitting the PR was ignoring unit test for V1 as we're encouraging migration to V2. It is now added anw. Pls have a look.

@phuhung273 phuhung273 force-pushed the distributed-map-query-lang branch from 41b4aaf to 2750938 Compare November 1, 2025 05:09
@phuhung273 phuhung273 requested a review from kumvprat November 1, 2025 11:02
@phuhung273 phuhung273 requested a review from kumvprat November 5, 2025 11:29
Copy link
Contributor

@kumvprat kumvprat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment in the test changes, apart from that it looks good.

@phuhung273
Copy link
Contributor Author

Thanks so much for the help @kumvprat

@mergify
Copy link
Contributor

mergify bot commented Nov 6, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 6, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 6, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Contributor

mergify bot commented Nov 6, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 75b8ead into aws:main Nov 6, 2025
19 of 20 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2025
@phuhung273 phuhung273 deleted the distributed-map-query-lang branch November 6, 2025 17:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort p1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stepfunctions: DistributedMap's ResultWriter with JsonATA generate invalid CF template

3 participants