object will be returned as an array. The date_part function is equivalent to the SQL-standard function EXTRACT(field FROM source). Making statements based on opinion; back them up with references or personal experience. trimStr - the trim string characters to trim, the default value is a single space. CASE expr1 WHEN expr2 THEN expr3 [WHEN expr4 THEN expr5]* [ELSE expr6] END - When expr1 = expr2, returns expr3; when expr1 = expr4, return expr5; else return expr6. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide, You shouln't need to have your data in list or map. This character may only be specified (counting from the right) is returned. The time column must be of TimestampType. map_entries(map) - Returns an unordered array of all entries in the given map. ), we can use array_distinct() function before applying collect_list function.In the following example, we can clearly observe that the initial sequence of the elements is kept. expr1 > expr2 - Returns true if expr1 is greater than expr2. Content Discovery initiative April 13 update: Related questions using a Review our technical responses for the 2023 Developer Survey, Extract column values of Dataframe as List in Apache Spark, Scala map list based on list element index, Method for reducing memory load of Spark program. string or an empty string, the function returns null. row of the window does not have any previous row), default is returned. input - string value to mask. sec(expr) - Returns the secant of expr, as if computed by 1/java.lang.Math.cos. multiple groups. A boy can regenerate, so demons eat him for years. max_by(x, y) - Returns the value of x associated with the maximum value of y. md5(expr) - Returns an MD5 128-bit checksum as a hex string of expr. How do the interferometers on the drag-free satellite LISA receive power without altering their geodesic trajectory? decode(bin, charset) - Decodes the first argument using the second argument character set. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. input_file_block_start() - Returns the start offset of the block being read, or -1 if not available. decode(expr, search, result [, search, result ] [, default]) - Compares expr padded with spaces. from_csv(csvStr, schema[, options]) - Returns a struct value with the given csvStr and schema.