Re: EXT: Re: Missing string replace function

2022-10-03 Thread Vibhor Gupta
es the things a little easier and neater. There are a lot of such missing APIs in scala and python. Regards, Vibhor From: russell.spit...@gmail.com Sent: Monday, October 3, 2022 12:31 AM To: Khalid Mammadov Cc: dev Subject: EXT: Re: Missing string replace fu

Re: Missing string replace function

2022-10-02 Thread russell . spitzer
Ah for that I think it makes sense to add in a function but it probably should not be an alias for regex replace since that has very different semantics for certain string argumentsSent from my iPhoneOn Oct 2, 2022, at 1:31 PM, Khalid Mammadov wrote:Thanks Russell for checking this out!This is a

Re: Missing string replace function

2022-10-02 Thread Khalid Mammadov
Thanks Russell for checking this out! This is a good example of a *replace* which is available in the Sapk SQL but not in the PySpark API nor in Scala API unfortunately. Another alternative to this is mentioned regexp_replace, but as a developer looking for *replace* function we tend to ignore reg

Re: Missing string replace function

2022-10-02 Thread Russell Spitzer
Quick test on on 3.2 confirms everything should be working as expected scala> spark.createDataset(Seq(("foo", "bar"))) res0: org.apache.spark.sql.Dataset[(String, String)] = [_1: string, _2: string] scala> spark.createDataset(Seq(("foo", "bar"))).createTempView("temp") scala> spark.sql("SELECT r

Re: Missing string replace function

2022-10-02 Thread Russell Spitzer
https://spark.apache.org/docs/3.3.0/api/sql/index.html#replace This was added in Spark 2.3.0 as far as I can tell. https://github.com/apache/spark/pull/18047 > On Oct 2, 2022, at 11:1