Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make call side of udf match the param side at compile time #151

Merged
merged 9 commits into from
Sep 14, 2023

Conversation

ingarabr
Copy link
Contributor

@ingarabr ingarabr commented Aug 24, 2023

Using shapeless to make sure that we call the udf with the right number of arguments.

val myUdf =
  UDF.temporary(
    ident"myUdf",
    UDF.Params.of(UDF.Param("foo", BQType.STRING)),
    UDF.Body.SQL(bqfr"(foo)"),
    Some(BQType.STRING)
  )
bqfr"${myUdf(ident"bar")}" // ok
bqfr"${myUdf()}" // compile error
bqfr"${myUdf(ident"bar1", ident"bar")}" // compile error

@hamnis
Copy link
Contributor

hamnis commented Sep 8, 2023

Needs a rebase of main and sbt prePR after

Using shapeless to make sure that we call the udf
with the right number of arguments.
ingarabr and others added 8 commits September 13, 2023 14:23
It's annoying to use the Sized class on the call side.
simplify nat for scala 3
trait Nat differs only in case from object nat in package no.nrk.bigquery.internal. Such classes will overwrite one another on case-insensitive filesystems.
Zeta sql native lib loades multiple times when running +test, causing
the jvm to crash
@ingarabr ingarabr marked this pull request as ready for review September 13, 2023 12:36
Copy link
Contributor

@HenningKoller HenningKoller left a comment

Choose a reason for hiding this comment

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

Cool!

@ingarabr ingarabr merged commit 08ce75e into main Sep 14, 2023
11 checks passed
@ingarabr ingarabr deleted the feature/improve-udf branch September 14, 2023 07:57
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