Skip to content

Commit

Permalink
REST-97 - ran scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
harshal359 committed Dec 8, 2023
1 parent 7ad138f commit b4c3797
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ object DataFrameTransformerImplicits {
schema
)
)

/**
* Converts the column with JSON string as value to struct type
*
Expand All @@ -482,16 +483,14 @@ object DataFrameTransformerImplicits {
* @param regex
* The Data Definition Language (DDL) for the column
* @return
* DataFrame
* DataFrame
*/

def filterByRegex(columnName: String, regex: String)
: DataFrame =
import df.sparkSession.implicits.*
val df1 = df.withColumn(columnName, regexp_extract(col(columnName), regex, 0))
val df2 = df1.where(col(columnName) =!= "")
df2

def filterByRegex(columnName: String, regex: String): DataFrame =
import df.sparkSession.implicits.*
val df1 = df.withColumn(columnName, regexp_extract(col(columnName), regex, 0))
val df2 = df1.where(col(columnName) =!= "")
df2

/**
* Flattens the schema of the dataframe. If any of the column is of StructType or is nested, this transformation
Expand Down

0 comments on commit b4c3797

Please sign in to comment.