Skip to content

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

Open
acustiq wants to merge 1 commit into
apache:b3.0from
acustiq:SPARKC-504-b3.0
Open

SPARKC-504: Allow null UDTs against b3.0 branch#1241
acustiq wants to merge 1 commit into
apache:b3.0from
acustiq:SPARKC-504-b3.0

Conversation

@acustiq

@acustiq acustiq commented Mar 31, 2020

Copy link
Copy Markdown

Same as PR #1228 rebased on b3.0

@acustiq
acustiq changed the base branch from master to b3.0 March 31, 2020 00:24
columnValues(i) = converters(i).convert(columnValues(i))
struct.newInstance(columnValues: _*)
case None =>
case _ =>

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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?

@RussellSpitzer RussellSpitzer Mar 31, 2020

Copy link
Copy Markdown
Member

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

Development

Successfully merging this pull request may close these issues.

2 participants