Skip to content

Conversation

@AngersZhuuuu
Copy link
Contributor

What changes were proposed in this pull request?

Since when UnsafeRow.getString return UTF8String, but Literal.apply() don't support UF8String.

In this patch support it.

Why are the changes needed?

Make Literal's constructor support UTF8String

Does this PR introduce any user-facing change?

When s is instance of UTF8String
user can use Literal(s)

How was this patch tested?

Not need

@AngersZhuuuu
Copy link
Contributor Author

ping @maropu @cloud-fan

@SparkQA
Copy link

SparkQA commented Feb 2, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39368/

@SparkQA
Copy link

SparkQA commented Feb 2, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39368/

@github-actions github-actions bot added the SQL label Feb 2, 2021
case b: Byte => Literal(b, ByteType)
case s: Short => Literal(s, ShortType)
case s: String => Literal(UTF8String.fromString(s), StringType)
case s: UTF8String => Literal(s, StringType)
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, Literal.apply is for external values. If you have internal values like UTF8String, you should use Literal(value, dt).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's don't do this here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, tried that all case can be handled. Close this one

@SparkQA
Copy link

SparkQA commented Feb 2, 2021

Test build #134781 has finished for PR 31438 at commit 27c7eb8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class Literal(value: Any, dataType: DataType) extends LeafExpression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants