Skip to content

First version of initializer support for 'to' block#186

Merged
agarciadom merged 3 commits intomainfrom
etl-to-initializer
Jun 12, 2025
Merged

First version of initializer support for 'to' block#186
agarciadom merged 3 commits intomainfrom
etl-to-initializer

Conversation

@agarciadom
Copy link
Contributor

@agarciadom agarciadom commented May 14, 2025

Fixes #125.

I had a first try at supporting initializer expressions in the to part of an ETL rule. I've tried implementing the change in the grammar, unparser, default strategy, and fast strategy, and created a test around this transformation:

rule Game2Game
  transform s: Points!points::Game
  to t: Coins!coins::Game
{
  t.coins ::= s.scores;
}

rule Score2Coin
  transform s: Points!PointScore
  to c: Coins!Coin = s.score > 5000 ? new Coins!GoldCoin : new Coins!SilverCoin
{
  // nothing to do
}

Let me know if I've missed anything :-).

@agarciadom
Copy link
Contributor Author

Looks like I'm failing some tests. I'll work a bit more on this PR later.

@agarciadom
Copy link
Contributor Author

The PR is now passing all tests - @kolovos can you check it?

@agarciadom agarciadom changed the title First version of initializer support for 'to' block (refs #125) First version of initializer support for 'to' block Jun 10, 2025
Copy link
Contributor

@kolovos kolovos left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@agarciadom agarciadom merged commit 0d1a09f into main Jun 12, 2025
5 checks passed
@agarciadom agarciadom deleted the etl-to-initializer branch June 12, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ETL] Add support for "to" initializers

2 participants