[ 
https://issues.apache.org/jira/browse/PIG-2729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416975#comment-13416975
 ] 

Johannes Schwenk commented on PIG-2729:
---------------------------------------

Hi Rohini,

sorry I didn't know about svn having problems with git diffs - I will fix that 
and post patches on reviewboard from now on...

1. Will fix that.
2. Sorry, I think I missunderstood you: I somehow thought that you wanted 
/x/y/../readme.pig beeing resolved to /x/readme.pig for "import 
'../readme.pig'; if the import path contained /x/y. This is obvoiusly not the 
case... So the correct behaviour is:

    1. Check if fname points to an existing file, is absolute, or relative
        yes => return localFileRet
        no => goto 2.
    2. For each importPath in pig.import.search.path
        - concatenate: importPath + File.separator + fname
        - check if file exists
            yes => return localFileRet
            no => continue with 2.
    3. Return localFileRet for fname.
    4. While doing 1.-3. throw RuntimeException if an IOException was 
encountered

Have I understood this correctly?

3. Yes, i removed this.

Thanks,
Johannes
                
> Macro expansion does not use pig.import.search.path - UnitTest borked
> ---------------------------------------------------------------------
>
>                 Key: PIG-2729
>                 URL: https://issues.apache.org/jira/browse/PIG-2729
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.2, 0.10.0
>         Environment: pig-0.9.2 and pig-0.10.0, hadoop-0.20.2 from Clouderas 
> distribution cdh3u3 on Kubuntu 12.04 64Bit.
>            Reporter: Johannes Schwenk
>             Fix For: 0.10.0
>
>         Attachments: PIG-2729.patch, test-macros.tar.gz, 
> use-search-path-for-imports.patch
>
>
> org.apache.pig.test.TestMacroExpansion, in function importUsingSearchPathTest 
> the import statement is provided with the full path to /tmp/mytest2.pig so 
> the pig.import.search.path is never used. I changed the import to 
> import 'mytest2.pig';
> and ran the UnitTest again. This time the test failed as expected from my 
> experience from earlier this day trying in vain to get pig eat my 
> pig.import.search.path property! Other properties in the same custom 
> properties file (provided via -propertyFile command line option) like 
> udf.import.list get read without any problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to