PREHOOK: query: DESCRIBE FUNCTION date_format PREHOOK: type: DESCFUNCTION POSTHOOK: query: DESCRIBE FUNCTION date_format POSTHOOK: type: DESCFUNCTION date_format(date/timestamp/string, fmt) - converts a date/timestamp/string to a value of string in the format specified by the date format fmt. PREHOOK: query: DESC FUNCTION EXTENDED date_format PREHOOK: type: DESCFUNCTION POSTHOOK: query: DESC FUNCTION EXTENDED date_format POSTHOOK: type: DESCFUNCTION date_format(date/timestamp/string, fmt) - converts a date/timestamp/string to a value of string in the format specified by the date format fmt. Supported formats are SimpleDateFormat formats - https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html. Second argument fmt should be constant. Example: > SELECT date_format('2015-04-08', 'y'); '2015' PREHOOK: query: explain select date_format('2015-04-08', 'EEEE') PREHOOK: type: QUERY POSTHOOK: query: explain select date_format('2015-04-08', 'EEEE') POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: TableScan alias: _dummy_table Row Limit Per Split: 1 Statistics: Num rows: 0 Data size: 1 Basic stats: PARTIAL Column stats: COMPLETE Select Operator expressions: 'Wednesday' (type: string) outputColumnNames: _col0 Statistics: Num rows: 0 Data size: 1 Basic stats: PARTIAL Column stats: COMPLETE ListSink PREHOOK: query: --string date select date_format('2015-04-08', 'E'), date_format('2015-04-08', 'G'), date_format('2015-04-08', 'y'), date_format('2015-04-08', 'Y'), date_format('2015-04-08', 'MMM'), date_format('2015-04-08', 'w'), date_format('2015-04-08', 'W'), date_format('2015-04-08', 'D'), date_format('2015-04-08', 'd'), date_format(cast(null as string), 'dd'), date_format('01/29/2014', 'dd') PREHOOK: type: QUERY PREHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### POSTHOOK: query: --string date select date_format('2015-04-08', 'E'), date_format('2015-04-08', 'G'), date_format('2015-04-08', 'y'), date_format('2015-04-08', 'Y'), date_format('2015-04-08', 'MMM'), date_format('2015-04-08', 'w'), date_format('2015-04-08', 'W'), date_format('2015-04-08', 'D'), date_format('2015-04-08', 'd'), date_format(cast(null as string), 'dd'), date_format('01/29/2014', 'dd') POSTHOOK: type: QUERY POSTHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### Wed AD 2015 2015 Apr 15 2 98 8 NULL NULL PREHOOK: query: --string timestamp select date_format('2015-04-08 10:30:45', 'HH'), date_format('2015-04-08 10:30:45', 'mm'), date_format('2015-04-08 10:30:45', 'ss'), date_format('2015-04-08 21:30:45', 'hh a'), date_format('2015-04-08 10:30', 'dd'), date_format('2015-04-08 10:30:45.123', 'S'), date_format('2015-04-08T10:30:45', 'dd'), date_format('2015-04-08 10', 'dd'), date_format(cast(null as string), 'dd'), date_format('04/08/2015 10:30:45', 'dd') PREHOOK: type: QUERY PREHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### POSTHOOK: query: --string timestamp select date_format('2015-04-08 10:30:45', 'HH'), date_format('2015-04-08 10:30:45', 'mm'), date_format('2015-04-08 10:30:45', 'ss'), date_format('2015-04-08 21:30:45', 'hh a'), date_format('2015-04-08 10:30', 'dd'), date_format('2015-04-08 10:30:45.123', 'S'), date_format('2015-04-08T10:30:45', 'dd'), date_format('2015-04-08 10', 'dd'), date_format(cast(null as string), 'dd'), date_format('04/08/2015 10:30:45', 'dd') POSTHOOK: type: QUERY POSTHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### 10 30 45 09 PM 08 123 08 08 NULL NULL PREHOOK: query: --date select date_format(cast('2015-04-08' as date), 'EEEE'), date_format(cast('2015-04-08' as date), 'G'), date_format(cast('2015-04-08' as date), 'yyyy'), date_format(cast('2015-04-08' as date), 'YY'), date_format(cast('2015-04-08' as date), 'MMM'), date_format(cast('2015-04-08' as date), 'w'), date_format(cast('2015-04-08' as date), 'W'), date_format(cast('2015-04-08' as date), 'D'), date_format(cast('2015-04-08' as date), 'd'), date_format(cast(null as date), 'dd') PREHOOK: type: QUERY PREHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### POSTHOOK: query: --date select date_format(cast('2015-04-08' as date), 'EEEE'), date_format(cast('2015-04-08' as date), 'G'), date_format(cast('2015-04-08' as date), 'yyyy'), date_format(cast('2015-04-08' as date), 'YY'), date_format(cast('2015-04-08' as date), 'MMM'), date_format(cast('2015-04-08' as date), 'w'), date_format(cast('2015-04-08' as date), 'W'), date_format(cast('2015-04-08' as date), 'D'), date_format(cast('2015-04-08' as date), 'd'), date_format(cast(null as date), 'dd') POSTHOOK: type: QUERY POSTHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### Wednesday AD 2015 15 Apr 15 2 98 8 NULL PREHOOK: query: --timestamp select date_format(cast('2015-04-08 10:30:45' as timestamp), 'HH'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'mm'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'ss'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'hh a'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'dd'), date_format(cast('2015-04-08 10:30:45.123' as timestamp), 'SSS'), date_format(cast('2015-04-08 10:30:45.123456789' as timestamp), 'SSS'), date_format(cast(null as timestamp), 'HH') PREHOOK: type: QUERY PREHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### POSTHOOK: query: --timestamp select date_format(cast('2015-04-08 10:30:45' as timestamp), 'HH'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'mm'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'ss'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'hh a'), date_format(cast('2015-04-08 10:30:45' as timestamp), 'dd'), date_format(cast('2015-04-08 10:30:45.123' as timestamp), 'SSS'), date_format(cast('2015-04-08 10:30:45.123456789' as timestamp), 'SSS'), date_format(cast(null as timestamp), 'HH') POSTHOOK: type: QUERY POSTHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### 10 30 45 10 AM 08 123 123 NULL PREHOOK: query: -- wrong fmt select date_format('2015-04-08', ''), date_format('2015-04-08', 'Q') PREHOOK: type: QUERY PREHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### POSTHOOK: query: -- wrong fmt select date_format('2015-04-08', ''), date_format('2015-04-08', 'Q') POSTHOOK: type: QUERY POSTHOOK: Input: _dummy_database@_dummy_table #### A masked pattern was here #### NULL