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-8214][SQL]Add function hex #6976

Closed
wants to merge 8 commits into from
Closed

Conversation

zhichao-li
Copy link
Contributor


/**
* Convert every character in s to two hex digits.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line.
use Converts instead of Convert

@SparkQA
Copy link

SparkQA commented Jun 24, 2015

Test build #35653 has finished for PR 6976 at commit f534efc.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

@SparkQA
Copy link

SparkQA commented Jun 24, 2015

Test build #35664 has finished for PR 6976 at commit aaaf841.

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

* Converts every character in s to two hex digits.
*/
private def hex(str: UTF8String): UTF8String = {
if (str == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the null checking, as it's did in eval already.

@chenghao-intel
Copy link
Contributor

LGTM, except some minor issues. Can you also remove the WIP?

@zhichao-li zhichao-li changed the title [SPARK-8214][SQL][WIP]Add function hex [SPARK-8214][SQL]Add function hex Jun 26, 2015
@SparkQA
Copy link

SparkQA commented Jun 26, 2015

Test build #35818 has finished for PR 6976 at commit a647641.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

@zhichao-li
Copy link
Contributor Author

@rxin could you please take a look at this ?

* Converts every character in s to two hex digits.
*/
private def hex(str: UTF8String): UTF8String = {
doHex(str.toString.getBytes, str.length())
Copy link
Contributor

Choose a reason for hiding this comment

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

If use 'UTF8' as the encoding here, it should be str.getBytes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would remove toString() here.

@SparkQA
Copy link

SparkQA commented Jun 29, 2015

Test build #35950 has finished for PR 6976 at commit 3b2fa13.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

@SparkQA
Copy link

SparkQA commented Jun 29, 2015

Test build #35951 has finished for PR 6976 at commit 967ec90.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

@SparkQA
Copy link

SparkQA commented Jun 29, 2015

Test build #35957 has finished for PR 6976 at commit cf9c936.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

* Converts every character in s to two hex digits.
*/
private def hex(str: UTF8String): UTF8String = {
doHex(str.getBytes, str.length())
Copy link
Contributor

Choose a reason for hiding this comment

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

UTF8String.length is the number of code points, not the number of bytes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would reuse the hex(bytes) method as a work around and add a unit test which contain chinese character to cover this.

@SparkQA
Copy link

SparkQA commented Jun 29, 2015

Test build #35972 has finished for PR 6976 at commit de3f5ea.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

@SparkQA
Copy link

SparkQA commented Jun 29, 2015

Test build #35978 has finished for PR 6976 at commit e218d1b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class Hex(child: Expression)
    • case class Hypot(left: Expression, right: Expression)

@davies
Copy link
Contributor

davies commented Jun 29, 2015

LGTM, merging this into master, thanks!

@asfgit asfgit closed this in 637b4ee Jun 29, 2015
@zhichao-li zhichao-li deleted the hex branch September 9, 2015 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants