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

SPARKC-504: Allow null UDTs against b3.0 branch #1241

Open
wants to merge 1 commit into
base: b3.0
Choose a base branch
from

Conversation

acustiq
Copy link

@acustiq acustiq commented Mar 31, 2020

Same as PR #1228 rebased on b3.0

@acustiq acustiq changed the base branch from master to b3.0 March 31, 2020 00:24
@@ -208,7 +208,7 @@ object MappedToGettableDataConverter extends StrictLogging {
for (i <- columnValues.indices)
columnValues(i) = converters(i).convert(columnValues(i))
struct.newInstance(columnValues: _*)
case None =>
case _ =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah my comment on _ was just that I thought we would explicitly match None and null just incase some other object got to this point in the match. I know that's impossible I just worry sometimes.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you see the case on line 204, "case obj if obj == null" Why doesn't this case match?

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried

 it should "convert null UDTs to null" in {
    val userTable = newTable(loginColumn, passwordColumn)
    val converter = MappedToGettableDataConverter[UserWithOption](userTable, userTable.columnRefs)
    val row = converter.convert(null)
    row shouldEqual null
  }

And this test passes without this code change, I think I may be missing something here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants