You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Prasanth Jayachandran (JIRA)" <ji...@apache.org> on 2016/01/18 09:16:40 UTC

[jira] [Commented] (HIVE-11097) HiveInputFormat uses String.startsWith to compare splitPath and PathToAliases

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

Prasanth Jayachandran commented on HIVE-11097:
----------------------------------------------

[~wanchang] The patch looks good to me. Can you please add the test case provided in the description to qfile test suite? You can do so by copying the tests to a new file under ql/src/test/queries/clientpositive/<filename>.q. Add the <filename.q> to itests/src/test/resources/testconfiguration.properties to variable "minimr.query.files". First time when you run the test case, you can generate the golden (output) files by doing the following steps

1) compile hive source from top level hive directory
{code}
mvn clean install -DskipTests
{code}
2) compile itests
{code}
cd itests
mvn clean install -DskipTests
{code}
3) Run test and generate output file
{code}
cd qtest
mvn test -Dtest=TestMinimrCliDriver -Dqfile=<filename>.q -Dtest.output.overwrite=true
{code}

With the above steps, your patch should be having java file, q file and q.out file. Let me know if you need more information. 
+1 for the current patch. 

> HiveInputFormat uses String.startsWith to compare splitPath and PathToAliases
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-11097
>                 URL: https://issues.apache.org/jira/browse/HIVE-11097
>             Project: Hive
>          Issue Type: Bug
>          Components: File Formats
>    Affects Versions: 0.13.0, 0.14.0, 0.13.1, 1.0.0, 1.2.0
>         Environment: Hive 0.13.1, Hive 2.0.0, hadoop 2.4.1
>            Reporter: Wan Chang
>            Assignee: Wan Chang
>            Priority: Critical
>         Attachments: HIVE-11097.1.patch
>
>
> Say we have a sql as
> {code}
> create table if not exists test_orc_src (a int, b int, c int) stored as orc;
> create table if not exists test_orc_src2 (a int, b int, d int) stored as orc;
> insert overwrite table test_orc_src select 1,2,3 from src limit 1;
> insert overwrite table test_orc_src2 select 1,2,4 from src limit 1;
> set hive.auto.convert.join = false;
> set hive.execution.engine=mr;
> select
>   tb.c
> from test.test_orc_src tb
> join (select * from test.test_orc_src2) tm
> on tb.a = tm.a
> where tb.b = 2
> {code}
> The correct result is 3 but it produced no result.
> I find that in HiveInputFormat.pushProjectionsAndFilters
> {code}
> match = splitPath.startsWith(key) || splitPathWithNoSchema.startsWith(key);
> {code}
> It uses startsWith to combine aliases with path, so tm will match two alias in this case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)