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

Better error message when defining a datatype for BQRead #246

Open
hamnis opened this issue Jan 8, 2024 · 0 comments
Open

Better error message when defining a datatype for BQRead #246

hamnis opened this issue Jan 8, 2024 · 0 comments

Comments

@hamnis
Copy link
Contributor

hamnis commented Jan 8, 2024

Sometimes when defining a derived bqread instance we might define the data type incorrectly,
now we can get error messages like:

java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "other" is null
	at no.nrk.bigquery.BQRead$$anon$2.read(BQRead.scala:120)
	at no.nrk.bigquery.BQRead$$anon$2.read(BQRead.scala:114)
	at no.nrk.bigquery.BQReadCompat.no$nrk$bigquery$BQReadCompat$$anon$1$$_$read$$anonfun$1(BQReadCompat.scala:38)
	at scala.collection.ArrayOps$.map$extension(ArrayOps.scala:932)
	at scala.IArray$package$IArray$.map(IArray.scala:179)
	at magnolia1.CaseClassDerivation$ProductCaseClass.construct(impl.scala:57)
	at no.nrk.bigquery.BQReadCompat$$anon$1.read(BQReadCompat.scala:40)
	at no.nrk.bigquery.BigQueryClient.synchronousQuery$$anonfun$1$$anonfun$1(BigQueryClient.scala:111)

The error is here that we get an optional value for the field, but our datatype has defined this as
String

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

No branches or pull requests

1 participant