Skip to content

[SPARK-28123][SQL] String Functions: support btrim#31080

Closed
beliefer wants to merge 1 commit intoapache:masterfrom
beliefer:SPARK-28123-btrim
Closed

[SPARK-28123][SQL] String Functions: support btrim#31080
beliefer wants to merge 1 commit intoapache:masterfrom
beliefer:SPARK-28123-btrim

Conversation

@beliefer
Copy link
Contributor

@beliefer beliefer commented Jan 7, 2021

What changes were proposed in this pull request?

The current implement of Trim/Ltrim/Rtrim only support string, but support byte array is very useful.
The function btrim supports byte array.

The mainstream database support this feature show below:

Postgresql
https://www.postgresql.org/docs/11/functions-binarystring.html

Vertica
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/SQLReferenceManual/Functions/String/BTRIM.htm?tocpath=SQL%20Reference%20Manual%7CSQL%20Functions%7CString%20Functions%7C_____5

Redshift
https://docs.aws.amazon.com/redshift/latest/dg/r_BTRIM.html

Druid
https://druid.apache.org/docs/latest/querying/sql.html#string-functions

Greenplum
http://docs.greenplum.org/6-8/ref_guide/function-summary.html

Why are the changes needed?

btrim is very useful.

Does this PR introduce any user-facing change?

Yes. btrim is a new function

How was this patch tested?

Jenkins test.

@beliefer beliefer changed the title [SPARK-28123][SQL] String Functions: Add support btrim [SPARK-28123][SQL] String Functions: support btrim Jan 7, 2021
@github-actions github-actions bot added the SQL label Jan 7, 2021
@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Test build #133780 has finished for PR 31080 at commit 179292f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class BinaryTrim(srcBinary: Expression, trimBinary: Option[Expression] = None)

@beliefer
Copy link
Contributor Author

beliefer commented Jan 7, 2021

retest this please

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

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

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

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

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Test build #133790 has finished for PR 31080 at commit 179292f.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class BinaryTrim(srcBinary: Expression, trimBinary: Option[Expression] = None)

@beliefer
Copy link
Contributor Author

beliefer commented Jan 7, 2021

retest this please

@SparkQA
Copy link

SparkQA commented Jan 7, 2021

Test build #133801 has started for PR 31080 at commit 179292f.

@beliefer
Copy link
Contributor Author

beliefer commented Jan 8, 2021

cc @cloud-fan

@srowen
Copy link
Member

srowen commented Jan 8, 2021

Per the other PR/JIRA discussion, I'm still skeptical about the use case for this function. IF it's just that legacy DBs support it, it may not be worth it just for that reason.

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.

3 participants

Comments