Skip to content

Conversation

@ingarabr
Copy link
Contributor

@ingarabr ingarabr commented May 11, 2023

When traversing bq-frag in collect we should first evaluate the inner udf bodies.

@ingarabr ingarabr requested a review from hamnis May 11, 2023 10:26
case BQSqlFrag.Call(udf, _) =>
udf match {
case UDF.Temporary(_, _, UDF.Body.Sql(body), _) => Some(body)
case UDF.Persistent(_, _, UDF.Body.Sql(body), _) => Some(body) // todo: should this be None?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For temporary functions it make sense to traverse the body. I do not see a reason for doing it for persistent functions. If we need to tap into them, then we can collect all the UDFs and call collect on the inner body element.

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed.

ingarabr added 2 commits May 11, 2023 15:12
We inline temporary UDFs and we need to traverse the body
to include other temporary UDFs that are referenced. We need
to do this first since they need to be crated in the right
order.
Fixed traversing in the previous commit.
@ingarabr ingarabr force-pushed the fix/traversing-bg-frag branch from bdfd846 to d28d657 Compare May 11, 2023 13:13
@ingarabr ingarabr requested a review from hamnis May 11, 2023 13:13
@ingarabr ingarabr merged commit 0f961f9 into main May 11, 2023
@ingarabr ingarabr deleted the fix/traversing-bg-frag branch May 11, 2023 13:18
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.

3 participants