Skip to content

Commit

Permalink
Assigning a pretty name - to_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Nov 3, 2018
1 parent 6969b49 commit 1895cdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,6 @@ case class StructsToCsv(
override def nullSafeEval(value: Any): Any = converter(value)

override def inputTypes: Seq[AbstractDataType] = StructType :: Nil

override def prettyName: String = "to_csv"
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ struct<>
-- !query 13
select to_csv(named_struct('a', 1, 'b', 2))
-- !query 13 schema
struct<structstocsv(named_struct(a, 1, b, 2)):string>
struct<to_csv(named_struct(a, 1, b, 2)):string>
-- !query 13 output
1,2


-- !query 14
select to_csv(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'))
-- !query 14 schema
struct<structstocsv(named_struct(time, to_timestamp('2015-08-26', 'yyyy-MM-dd'))):string>
struct<to_csv(named_struct(time, to_timestamp('2015-08-26', 'yyyy-MM-dd'))):string>
-- !query 14 output
26/08/2015

Expand Down

0 comments on commit 1895cdc

Please sign in to comment.