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

[SPARK-23589][SQL][FOLLOW-UP] Reuse InternalRow in ExternalMapToCatalyst eval #21137

Closed
wants to merge 2 commits into from

Conversation

maropu
Copy link
Member

@maropu maropu commented Apr 24, 2018

What changes were proposed in this pull request?

This pr is a follow-up of #20980 and fixes code to reuse InternalRow for converting input keys/values in ExternalMapToCatalyst eval.

How was this patch tested?

Existing tests.

@maropu
Copy link
Member Author

maropu commented Apr 24, 2018

@hvanhovell

@SparkQA
Copy link

SparkQA commented Apr 24, 2018

Test build #89760 has finished for PR 21137 at commit b39b6cd.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@maropu
Copy link
Member Author

maropu commented Apr 24, 2018

retest this please

@@ -1255,6 +1255,13 @@ case class ExternalMapToCatalyst private(
override def dataType: MapType = MapType(
keyConverter.dataType, valueConverter.dataType, valueContainsNull = valueConverter.nullable)

private lazy val rowBuffer = InternalRow.fromSeq(Array[Any](1))
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to make this expression wide state. Just move this inside the mapCatalystConverter def.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

} else {
throw new RuntimeException("Cannot use null as map key!")
}
values(i) = if (value != null) {
valueConverter.eval(InternalRow.fromSeq(value :: Nil))
valueConverter.eval(rowWrapper(value))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also change lines 1299 & 1304?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

@hvanhovell hvanhovell left a comment

Choose a reason for hiding this comment

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

LGTM - pending jenkins

@SparkQA
Copy link

SparkQA commented Apr 24, 2018

Test build #89770 has finished for PR 21137 at commit b39b6cd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 24, 2018

Test build #89779 has finished for PR 21137 at commit 6bfcd7a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@hvanhovell
Copy link
Contributor

hvanhovell commented Apr 24, 2018

Merging to master. Thanks!

@asfgit asfgit closed this in 4926a7c Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants