<?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: mismatched input 'AS' expecting RIGHT_PAREN in Pig in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191402#M153487</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/66220/rsoni.html" nodeid="66220"&gt;@Rahul Soni&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I edited the comment.Please check it.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 16:50:09 GMT</pubDate>
    <dc:creator>priyal</dc:creator>
    <dc:date>2018-03-23T16:50:09Z</dc:date>
    <item>
      <title>mismatched input 'AS' expecting RIGHT_PAREN in Pig</title>
      <link>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191398#M153483</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to fetch url ,methods and class from the below line using Pig Script:&lt;/P&gt;&lt;BLOCKQUOTE&gt;Mapped "{[/aLog/transaction],methods=[POST],produces=[application/vnd.app.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity&amp;lt;java.lang.Object&amp;gt; com.fhlb.user.controller.rest.ALogService.aTransactionDetails(com.fhlb.user.beans.TansactionReportRequest,javax.servlet.http.HttpServletRequest) throws com.fhlb.commons.CustomException,java.io.FileNotFoundException&lt;/BLOCKQUOTE&gt;&lt;P&gt;Here is my Pig Script :&lt;/P&gt;&lt;PRE&gt;extract = FOREACH logs_entry GENERATE FLATTEN(REGEX_EXTRACT_ALL(logmessage,'^(Mapped)\\"(\\{+(\\[+([^/].*)+\\]),methods=(\\[+([A-Z].*)+\\]),produces=(\\[+([^ ].*)+\\])+\\}\\)"\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(throws)\\s+(.*)
AS (t1:chararray,url:chararray,type:chararray,produces:chararray,t2:chararray,t3:chararray,classes:chararray,throw:chararray,exception:chararray);&lt;/PRE&gt;&lt;P&gt;But I got below error :&lt;/P&gt;&lt;BLOCKQUOTE&gt;ERROR 1200: &amp;lt;line 9, column 229&amp;gt;  mismatched input 'AS' expecting RIGHT_PAREN &lt;/BLOCKQUOTE&gt;&lt;P&gt;I am not good at regex so please help me to find out the solution.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 20:29:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191398#M153483</guid>
      <dc:creator>priyal</dc:creator>
      <dc:date>2018-03-22T20:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: mismatched input 'AS' expecting RIGHT_PAREN in Pig</title>
      <link>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191399#M153484</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/17036/priyal.html" nodeid="17036"&gt;@priyal patel&lt;/A&gt;&lt;P&gt;Your statement has a syntax issue and that is why you are getting the current error. So if you retype your pig script as follows, you won't have the syntax error.&lt;/P&gt;&lt;PRE&gt;extract = FOREACH a GENERATE FLATTEN(REGEX_EXTRACT_ALL(rec,'^(Mapped)\\"(\\{+(\\[+([^/].*)+\\]),methods=(\\[+([A-Z].*)+\\]),produces=(\\[+([^ ].*)+\\])+\\}\\)"\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(throws)\\s+(.*)')) AS (t1:chararray,url:chararray,type:chararray,produces:chararray,t2:chararray,t3:chararray,classes:chararray,throw:chararray,exception:chararray);&lt;/PRE&gt;&lt;P&gt;Now, your regex is as is as you mentioned in the question. I need some more info regarding what you want to fetch out of this error message. And then we can work on the desired regex.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 01:54:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191399#M153484</guid>
      <dc:creator>RahulSoni</dc:creator>
      <dc:date>2018-03-23T01:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: mismatched input 'AS' expecting RIGHT_PAREN in Pig</title>
      <link>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191400#M153485</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/66220/rsoni.html" nodeid="66220"&gt;@Rahul Soni&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Actually its a type mistake.I edited my question and i found that i forgot to close ' ')) '. &lt;/P&gt;&lt;P&gt;I want to fetch following values , &lt;/P&gt;&lt;PRE&gt;[/aLog/transaction],POST,[application/vnd.app.v1+json || application/json]&lt;/PRE&gt;&lt;P&gt;
I tried below script, &lt;/P&gt;&lt;PRE&gt;extract = FOREACH matched GENERATE FLATTEN(REGEX_EXTRACT_ALL(logmessage,'^(\\S+)\\s+"(\\{(\\S+),.*=(.*),.*=(.*)\\})"+\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+).*
(t1:chararray,t2:chararray,t3:chararray,t4:chararray,url:chararray,type:chararray,produces:chararray,t5:chararray,t6:chararray,classes:chararray,throw:chararray,exception:chararray); &lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Output : &lt;/P&gt;&lt;PRE&gt;(Mapped,&lt;STRONG&gt;{[/auditConfirmation/businessDates],methods=[GET],produces=[application/vnd.app.v1+json || application/json]}&lt;/STRONG&gt;,[/auditConfirmation/businessDates],[GET],[application/vnd.app.v1+json || application/json],on
to,public,java.lang.String,com.fhlb.controllers.rest.auditconfirmation.AuditConfirmationRestService.getCloseOFBusinessDates(java.lang.String),throws,com.fhlb.commons.CustomException)&lt;/PRE&gt;&lt;P&gt; 
I fetched the output which i want But i am getting one extra schema.Could you help me with regex which extract only expected output.I want to remove &lt;STRONG&gt;"{[/auditConfirmation/businessDates],methods=[GET],produces=[application/vnd.app.v1+json || application/json]}"  &lt;/STRONG&gt;from the output.&lt;/P&gt;&lt;P&gt;I got the Expected output using below script :&lt;/P&gt;&lt;PRE&gt;output = FOREACH extract GENERATE $4 as url,$5 as requesttype,$6 as produces;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Mar 2018 12:41:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191400#M153485</guid>
      <dc:creator>priyal</dc:creator>
      <dc:date>2018-03-23T12:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: mismatched input 'AS' expecting RIGHT_PAREN in Pig</title>
      <link>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191401#M153486</link>
      <description>&lt;P&gt;Sorry but can you please put the pattern a bit more clearly? A bit hard to understand in the format you mentioned.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:22:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191401#M153486</guid>
      <dc:creator>RahulSoni</dc:creator>
      <dc:date>2018-03-23T13:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: mismatched input 'AS' expecting RIGHT_PAREN in Pig</title>
      <link>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191402#M153487</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/66220/rsoni.html" nodeid="66220"&gt;@Rahul Soni&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I edited the comment.Please check it.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 16:50:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/mismatched-input-AS-expecting-RIGHT-PAREN-in-Pig/m-p/191402#M153487</guid>
      <dc:creator>priyal</dc:creator>
      <dc:date>2018-03-23T16:50:09Z</dc:date>
    </item>
  </channel>
</rss>

