Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

end of line character Hue PIG editor

end of line character Hue PIG editor

New Contributor

Hi there,

 

we have running a cloudera Cluster and want to run a PIG scripts which uses regular expressions.

 

The Issue is now, that we have to use the "$" character in the regular expression to set the end of line.

The Pig Editor of Hue is interpreting that as an Possible parameter and therefore fails to run the script.

 

Somebody has a clue what to do?

 

Cheers,

 

Malte

4 REPLIES 4

Re: end of line character Hue PIG editor

This seems like a bug indeed: https://issues.cloudera.org/browse/HUE-1958

 

In the meantime, when prompted for: '
could you specify: $'

as a workaround?

 

Romain

Re: end of line character Hue PIG editor

New Contributor

Hi there and thanks for you answer.

 

At least for me that doesn't work, I am getting the following error:

 

2014-02-13 09:05:48,845 [main] INFO  org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor  - The parameter: "'=$'" cannot be parsed by Pig. Please double check it
2014-02-13 09:05:48,845 [main] INFO org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor - The parameter: "'=$'" cannot be parsed by Pig. Please double check it
2014-02-13 09:05:48,845 [main] INFO org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor - Parser give the follow error message:
2014-02-13 09:05:48,845 [main] INFO org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor - Parser give the follow error message:
2014-02-13 09:05:48,845 [main] INFO org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor - Encountered " <LITERAL> "\'=$\' "" at line 1, column 1.

Re: end of line character Hue PIG editor

New Contributor

Furthermore I experienced three more issues.

 

After removing the '$' character again the execution of the script staid in the error case by replacing the $ with $', it seemed to me, that the script was not recompiled.

 

The solution was to restart the HUE service.

 

Furthermore we had the issue that the UDF toDate threw a NullPointerException yesterday. This issue has also been solved by restarting the service.

 

There is also a translation bug, I am running the service with german language.

When I insert a parameter to be substituted in the script and press the launch button the popup dailogue states:

 

"Skript ausführen 'skriptXy wirklich löschen?" what in english means "Exectute Script 'skriptXy' Do you really want to delete it?"

 

Cheers

 

 

Re: end of line character Hue PIG editor

We are going to improve the refresh of the script when there is an error, normally you don't need to restart the service but refresh the page or click on 'Pig Editor' title or 'Pig' in the menu.

 

I did a test and using something like $dollar and specifying just $ in the popup worked (ex below)

 

The translation should mean:
Run Script 'Unsaved script' ?

In the latest version (C5b2) I am seeing:

Skript ausführen 'Nicht gespeichertes Skript' ?

 

 

Test script:
data = LOAD '/user/hue/pig/examples/data/midsummer.txt' as (text:CHARARRAY);

upper_case =  FOREACH data GENERATE REGEX_EXTRACT('192.168.1.5:8020', '(.*):(.*)$dollar', 1);

STORE upper_case INTO '$output' ;