You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Jakob Homan <jg...@apache.org> on 2011/08/05 03:22:01 UTC

Review Request: DESCRIBE TABLE causes NPE when hive.cli.print.header=true

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1300/
-----------------------------------------------------------

Review request for hive.


Summary
-------

Commands that don't return a schema cause NPE when print headers is on.


This addresses bug HIVE-2334.
    https://issues.apache.org/jira/browse/HIVE-2334


Diffs
-----

  cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 9fa7bc6 
  cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java PRE-CREATION 
  ivy/libraries.properties af856bd 

Diff: https://reviews.apache.org/r/1300/diff


Testing
-------

New unit tests (both positive and negative) and verification on manual cluster.


Thanks,

Jakob


Re: Review Request: DESCRIBE TABLE causes NPE when hive.cli.print.header=true

Posted by Jakob Homan <jg...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1300/
-----------------------------------------------------------

(Updated 2011-08-15 20:12:23.939812)


Review request for hive and Carl Steinbach.


Changes
-------

Updated diff now that HIVE-2171 has been committed.  Removes inclusion of mockito, which was handled in the other JIRA.  Otherwise, no changes.


Summary
-------

Commands that don't return a schema cause NPE when print headers is on.


This addresses bug HIVE-2334.
    https://issues.apache.org/jira/browse/HIVE-2334


Diffs (updated)
-----

  cli/build.xml c174b22 
  cli/ivy.xml f272b91 
  cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java a2976b5 
  cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java PRE-CREATION 
  ql/src/test/queries/clientpositive/print_header.q 96380ab 
  ql/src/test/results/clientpositive/print_header.q.out e3946d7 

Diff: https://reviews.apache.org/r/1300/diff


Testing
-------

New unit tests (both positive and negative) and verification on manual cluster.


Thanks,

Jakob


Re: Review Request: DESCRIBE TABLE causes NPE when hive.cli.print.header=true

Posted by Jakob Homan <jg...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1300/
-----------------------------------------------------------

(Updated 2011-08-08 22:42:22.232604)


Review request for hive.


Changes
-------

* Removed star imports in unit test.
* Added test case to integration test.  Call to use default NPEs before patch, succeeds afterwards
* Removed no-op from cli/build.xml to ensure test runs
* Added mockito into cli's ivy.xml.  The top-level ivy.xml doesn't need changed since the ivy settings aren't inherited.
* Didn't change the split call to tokenize, since it was as is in the original patch.  No need to introduce unnecessary changes. 


Summary
-------

Commands that don't return a schema cause NPE when print headers is on.


This addresses bug HIVE-2334.
    https://issues.apache.org/jira/browse/HIVE-2334


Diffs (updated)
-----

  cli/build.xml c174b22 
  cli/ivy.xml f272b91 
  cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 9fa7bc6 
  cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java PRE-CREATION 
  ivy/libraries.properties af856bd 
  ql/src/test/queries/clientpositive/print_header.q 96380ab 
  ql/src/test/results/clientpositive/print_header.q.out e3946d7 

Diff: https://reviews.apache.org/r/1300/diff


Testing
-------

New unit tests (both positive and negative) and verification on manual cluster.


Thanks,

Jakob


Re: Review Request: DESCRIBE TABLE causes NPE when hive.cli.print.header=true

Posted by Carl Steinbach <ca...@cloudera.com>.

> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java, line 1
> > <https://reviews.apache.org/r/1300/diff/1/?file=30860#file30860line1>
> >
> >     cli/build.xml overrides the ant test target with a no-op, so this test is actually not getting run.
> 
> Jakob Homan wrote:
>     I'll update cli/build.xml to not be a no-op, unless there's some reason to?

Yup, it needs to be update, or your test will never get run. Inheriting the test target definition from build-common.xml is probably the best option if it works.


> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > ivy/libraries.properties, line 47
> > <https://reviews.apache.org/r/1300/diff/1/?file=30861#file30861line47>
> >
> >     We need to manage this dependency with Ivy. The Hive build currently runs against hadoop-0.20.1, which does not include mockito-all-1.8.2.jar
> 
> Jakob Homan wrote:
>     I'm sorry; I don't understand.  This is being brought in by Ivy?  As part of HIVE-2171, I had mentioned we need to make sure testing related jars don't get included during binary/package, but that should be done in a different JIRA.

Right now the dependency on mockito is unsatisfied. I tried updating cli/build.xml to fix the test target problem and ended up getting a bunch of compilation errors since the mockito jar is not on the classpath.

> As part of HIVE-2171, I had mentioned we need to make sure testing related jars don't get included during binary/package, but that should be done in a different JIRA.

Ivy supports this behavior through the use of configurations. We need to add a 'test' configuration to the root ivy.xml file:

<conf name="test" extends="compile" visibility="private"/>

And then add mockito to the list of dependencies:

<dependency org="org.mockito" name="mockito-all" rev="${mockito-all.version}" conf="test->default"/>


> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java, line 37
> > <https://reviews.apache.org/r/1300/diff/1/?file=30860#file30860line37>
> >
> >     There's already some very limited test coverage for the hive.cli.print.header feature in print_header.q. Why not extend this testcase instead of adding a new unit test?
> 
> Jakob Homan wrote:
>     Because this is an actual unit test against a specific regression, which has value separate from the print_header.q integration test.  I can add additional content to print_header.q, since this test is easier to identify what's gone wrong and runs in about 0.2 seconds, this one seems more useful.

Ok. Please update print_header.q with some additional tests.


- Carl


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1300/#review1308
-----------------------------------------------------------


On 2011-08-05 01:22:01, Jakob Homan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/1300/
> -----------------------------------------------------------
> 
> (Updated 2011-08-05 01:22:01)
> 
> 
> Review request for hive.
> 
> 
> Summary
> -------
> 
> Commands that don't return a schema cause NPE when print headers is on.
> 
> 
> This addresses bug HIVE-2334.
>     https://issues.apache.org/jira/browse/HIVE-2334
> 
> 
> Diffs
> -----
> 
>   cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 9fa7bc6 
>   cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java PRE-CREATION 
>   ivy/libraries.properties af856bd 
> 
> Diff: https://reviews.apache.org/r/1300/diff
> 
> 
> Testing
> -------
> 
> New unit tests (both positive and negative) and verification on manual cluster.
> 
> 
> Thanks,
> 
> Jakob
> 
>


Re: Review Request: DESCRIBE TABLE causes NPE when hive.cli.print.header=true

Posted by Jakob Homan <jg...@apache.org>.

> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java, line 235
> > <https://reviews.apache.org/r/1300/diff/1/?file=30859#file30859line235>
> >
> >     Might want to consider using StringTokenizer or StreamTokenizer here.

This is how it was in the original code.  All of this can actually be done quite a bit better.  I'm happy to switch to tokenizer; the patch is a bit schizophrenic about refactoring/improving.  I didn't change this since it's not directly related to what I was trying to test.


> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java, line 37
> > <https://reviews.apache.org/r/1300/diff/1/?file=30860#file30860line37>
> >
> >     There's already some very limited test coverage for the hive.cli.print.header feature in print_header.q. Why not extend this testcase instead of adding a new unit test?

Because this is an actual unit test against a specific regression, which has value separate from the print_header.q integration test.  I can add additional content to print_header.q, since this test is easier to identify what's gone wrong and runs in about 0.2 seconds, this one seems more useful.  


> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > ivy/libraries.properties, line 47
> > <https://reviews.apache.org/r/1300/diff/1/?file=30861#file30861line47>
> >
> >     We need to manage this dependency with Ivy. The Hive build currently runs against hadoop-0.20.1, which does not include mockito-all-1.8.2.jar

I'm sorry; I don't understand.  This is being brought in by Ivy?  As part of HIVE-2171, I had mentioned we need to make sure testing related jars don't get included during binary/package, but that should be done in a different JIRA.


> On 2011-08-05 20:38:11, Carl Steinbach wrote:
> > cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java, line 1
> > <https://reviews.apache.org/r/1300/diff/1/?file=30860#file30860line1>
> >
> >     cli/build.xml overrides the ant test target with a no-op, so this test is actually not getting run.

I'll update cli/build.xml to not be a no-op, unless there's some reason to?


- Jakob


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1300/#review1308
-----------------------------------------------------------


On 2011-08-05 01:22:01, Jakob Homan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/1300/
> -----------------------------------------------------------
> 
> (Updated 2011-08-05 01:22:01)
> 
> 
> Review request for hive.
> 
> 
> Summary
> -------
> 
> Commands that don't return a schema cause NPE when print headers is on.
> 
> 
> This addresses bug HIVE-2334.
>     https://issues.apache.org/jira/browse/HIVE-2334
> 
> 
> Diffs
> -----
> 
>   cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 9fa7bc6 
>   cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java PRE-CREATION 
>   ivy/libraries.properties af856bd 
> 
> Diff: https://reviews.apache.org/r/1300/diff
> 
> 
> Testing
> -------
> 
> New unit tests (both positive and negative) and verification on manual cluster.
> 
> 
> Thanks,
> 
> Jakob
> 
>


Re: Review Request: DESCRIBE TABLE causes NPE when hive.cli.print.header=true

Posted by Carl Steinbach <ca...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1300/#review1308
-----------------------------------------------------------



cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
<https://reviews.apache.org/r/1300/#comment2967>

    Might want to consider using StringTokenizer or StreamTokenizer here.



cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java
<https://reviews.apache.org/r/1300/#comment2963>

    cli/build.xml overrides the ant test target with a no-op, so this test is actually not getting run.



cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java
<https://reviews.apache.org/r/1300/#comment2964>

    Wildcard imports violate the checkstyle guidelines.



cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java
<https://reviews.apache.org/r/1300/#comment2965>

    There's already some very limited test coverage for the hive.cli.print.header feature in print_header.q. Why not extend this testcase instead of adding a new unit test?



ivy/libraries.properties
<https://reviews.apache.org/r/1300/#comment2966>

    We need to manage this dependency with Ivy. The Hive build currently runs against hadoop-0.20.1, which does not include mockito-all-1.8.2.jar


- Carl


On 2011-08-05 01:22:01, Jakob Homan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/1300/
> -----------------------------------------------------------
> 
> (Updated 2011-08-05 01:22:01)
> 
> 
> Review request for hive.
> 
> 
> Summary
> -------
> 
> Commands that don't return a schema cause NPE when print headers is on.
> 
> 
> This addresses bug HIVE-2334.
>     https://issues.apache.org/jira/browse/HIVE-2334
> 
> 
> Diffs
> -----
> 
>   cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 9fa7bc6 
>   cli/src/test/org/apache/hadoop/hive/cli/TestCliDriverMethods.java PRE-CREATION 
>   ivy/libraries.properties af856bd 
> 
> Diff: https://reviews.apache.org/r/1300/diff
> 
> 
> Testing
> -------
> 
> New unit tests (both positive and negative) and verification on manual cluster.
> 
> 
> Thanks,
> 
> Jakob
> 
>