<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: HIve Error: parser exception cannot recognize input in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/HIve-Error-parser-exception-cannot-recognize-input/m-p/192719#M154783</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/50177/adithya3838.html" nodeid="50177"&gt;@Adithya Sajjanam&lt;/A&gt;&lt;P&gt;sys_extract_utc is not a valid Hive function. You are translating your Oracle query as is and that's why getting this error. You can refer to the &lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions"&gt;Hive documentation&lt;/A&gt; for reference to Date functions in hive and translate your query from Oracle syntax to Hive QL accordingly.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Mar 2018 09:02:04 GMT</pubDate>
    <dc:creator>RahulSoni</dc:creator>
    <dc:date>2018-03-26T09:02:04Z</dc:date>
    <item>
      <title>HIve Error: parser exception cannot recognize input</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HIve-Error-parser-exception-cannot-recognize-input/m-p/192718#M154782</link>
      <description>&lt;PRE&gt;select cast(10000 as int),
           case data_type
            when 'TIMESTAMP' then
    		  concat('     ,cast((cast(sys_extract_utc(update_time) AS DATE) - TO_DATE('01-01-1970 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) * 86400 AS INT) last_date_time_ts')
            else
              concat('     ,#unknown data_type : ', data_type)
           end
      from (select row_number() over() ln, table_name, column_name, data_type, column_id 
              from test.all_tab_columns
             where date_key in (select max(date_key) from test.all_tab_columns)
               and table_name = 'test_table'
                      ) data
&lt;/PRE&gt;&lt;PRE&gt;Tried to extract the the last updated time using below query.  hive is throwing exception
&lt;/PRE&gt;&lt;P&gt;
	Error: Error while compiling statement: FAILED: ParseException line 4:7 cannot recognize input near ''cast((cast(sys_extract_utc(update_time) AS DATE) - TO_DATE('' '01' '-' in expression specification (state=42000,code=40000)&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 06:41:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HIve-Error-parser-exception-cannot-recognize-input/m-p/192718#M154782</guid>
      <dc:creator>adithya3838</dc:creator>
      <dc:date>2018-03-26T06:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: HIve Error: parser exception cannot recognize input</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HIve-Error-parser-exception-cannot-recognize-input/m-p/192719#M154783</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/50177/adithya3838.html" nodeid="50177"&gt;@Adithya Sajjanam&lt;/A&gt;&lt;P&gt;sys_extract_utc is not a valid Hive function. You are translating your Oracle query as is and that's why getting this error. You can refer to the &lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions"&gt;Hive documentation&lt;/A&gt; for reference to Date functions in hive and translate your query from Oracle syntax to Hive QL accordingly.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 09:02:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HIve-Error-parser-exception-cannot-recognize-input/m-p/192719#M154783</guid>
      <dc:creator>RahulSoni</dc:creator>
      <dc:date>2018-03-26T09:02:04Z</dc:date>
    </item>
  </channel>
</rss>

