You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Nishant Kelkar <ni...@gmail.com> on 2015/06/27 22:32:59 UTC

Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

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

Review request for hive and Alexander Pivovarov.


Repository: hive-git


Description
-------

1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.


Diffs
-----

  .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_error_2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
  ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 

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


Testing
-------


Thanks,

Nishant Kelkar


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Alexander Pivovarov <ap...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/#review89635
-----------------------------------------------------------



.reviewboardrc 
<https://reviews.apache.org/r/35968/#comment142287>

    this file should not be in the patch



ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 
<https://reviews.apache.org/r/35968/#comment142288>

    Try to minimize the changes in existing classes.
    I do not think we shoul replace list of imports with *



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 4)
<https://reviews.apache.org/r/35968/#comment142297>

    I can not find "import org.apache.commons.math3" in other classes. I'm not sure hive-exec has explicit dependency on commons-math3 jar



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 12)
<https://reviews.apache.org/r/35968/#comment142289>

    do not use * for import



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 26)
<https://reviews.apache.org/r/35968/#comment142290>

    it should be full stop at the end. remove trailing space



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 28)
<https://reviews.apache.org/r/35968/#comment142291>

    I do not think we need new line in the middle of the sentence.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 29)
<https://reviews.apache.org/r/35968/#comment142292>

    Can you add Example?



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 32)
<https://reviews.apache.org/r/35968/#comment142293>

    why final?



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 39)
<https://reviews.apache.org/r/35968/#comment142294>

    add check for null and return null. In most cases Hive UDFs do not throw exception if args are null. UDF should just return null.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 47)
<https://reviews.apache.org/r/35968/#comment142295>

    Use class field FloatWritable and use set() method instead of creating new FloatWritable on evry wor



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 50)
<https://reviews.apache.org/r/35968/#comment142296>

    why private? I recommend to use protected to have an ability to extend your UDF in future and create another UDF with slightly different behavious



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 60)
<https://reviews.apache.org/r/35968/#comment142298>

    Why you cast value to float in the middle of the calculation.
    I recommend to use double internally and convert final result of calculation to float



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 63)
<https://reviews.apache.org/r/35968/#comment142301>

    Probably it's better to make it protected



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 72)
<https://reviews.apache.org/r/35968/#comment142300>

    Hive UDF should return null in case input data is null or invalid



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 81)
<https://reviews.apache.org/r/35968/#comment142306>

    It can be top level class or at least "public static"



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 88)
<https://reviews.apache.org/r/35968/#comment142304>

    UDF should not throw exceptions in evaluate method



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 93)
<https://reviews.apache.org/r/35968/#comment142307>

    forgot generic. Probably it should be HashSet<String>



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 109)
<https://reviews.apache.org/r/35968/#comment142303>

    UDF should not throw exceptions in evaluate method



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 122)
<https://reviews.apache.org/r/35968/#comment142302>

    UDF should not throw exceptions in evaluate method


- Alexander Pivovarov


On June 27, 2015, 8:32 p.m., Nishant Kelkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35968/
> -----------------------------------------------------------
> 
> (Updated June 27, 2015, 8:32 p.m.)
> 
> 
> Review request for hive and Alexander Pivovarov.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.
> 
> 
> Diffs
> -----
> 
>   .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_error_2.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
>   ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35968/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Nishant Kelkar
> 
>


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/#review89671
-----------------------------------------------------------



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 32)
<https://reviews.apache.org/r/35968/#comment142333>

    You're right, we could potentially extend this method.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 72)
<https://reviews.apache.org/r/35968/#comment142335>

    These still throw HiveException, but I've included all of the code in evaluate() in try/catch, and catch returns null.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 88)
<https://reviews.apache.org/r/35968/#comment142336>

    These still throw HiveException, but I've included all of the code in evaluate() in try/catch, and catch returns null.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 109)
<https://reviews.apache.org/r/35968/#comment142337>

    These still throw HiveException, but I've included all of the code in evaluate() in try/catch, and catch returns null.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 122)
<https://reviews.apache.org/r/35968/#comment142338>

    These still throw HiveException, but I've included all of the code in evaluate() in try/catch, and catch returns null.


- Nishant Kelkar


On June 28, 2015, 11:22 a.m., Nishant Kelkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35968/
> -----------------------------------------------------------
> 
> (Updated June 28, 2015, 11:22 a.m.)
> 
> 
> Review request for hive and Alexander Pivovarov.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.
> 
> 
> Diffs
> -----
> 
>   .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
>   ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35968/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Nishant Kelkar
> 
>


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/
-----------------------------------------------------------

(Updated June 29, 2015, 9:24 p.m.)


Review request for hive and Alexander Pivovarov.


Changes
-------

Removed dependency on commons-math3 FastMath class.


Repository: hive-git


Description
-------

1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.


Diffs (updated)
-----

  .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
  ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 

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


Testing
-------

Function signature of the UDF is: cosine_similarity(Text, Text, Text)

Each "Text" can be one of {S=something,E=empty,N=null}

Unit tests written for the following cases:
1. cosine_similarity(S, S, S)
2. cosine_similarity(S, E, S)
3. cosine_similarity(N, E, S)
4. cosine_similarity(S, S, E)
5. cosine_similarity(N, N, N)


Thanks,

Nishant Kelkar


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/#review89800
-----------------------------------------------------------



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 4)
<https://reviews.apache.org/r/35968/#comment142597>

    Oh, sorry didn't read well. You mean math3. Yes, you're right about this. Moving to use 
    
    {code}
    Math.pow(double, double)
    {code}
    
    instead.


- Nishant Kelkar


On June 28, 2015, 11:39 a.m., Nishant Kelkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35968/
> -----------------------------------------------------------
> 
> (Updated June 28, 2015, 11:39 a.m.)
> 
> 
> Review request for hive and Alexander Pivovarov.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.
> 
> 
> Diffs
> -----
> 
>   .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
>   ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35968/diff/
> 
> 
> Testing
> -------
> 
> Function signature of the UDF is: cosine_similarity(Text, Text, Text)
> 
> Each "Text" can be one of {S=something,E=empty,N=null}
> 
> Unit tests written for the following cases:
> 1. cosine_similarity(S, S, S)
> 2. cosine_similarity(S, E, S)
> 3. cosine_similarity(N, E, S)
> 4. cosine_similarity(S, S, E)
> 5. cosine_similarity(N, N, N)
> 
> 
> Thanks,
> 
> Nishant Kelkar
> 
>


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/
-----------------------------------------------------------

(Updated June 28, 2015, 11:39 a.m.)


Review request for hive and Alexander Pivovarov.


Changes
-------

Added description for tests performed in "Tests Done" section.


Repository: hive-git


Description
-------

1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.


Diffs
-----

  .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
  ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 

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


Testing (updated)
-------

Function signature of the UDF is: cosine_similarity(Text, Text, Text)

Each "Text" can be one of {S=something,E=empty,N=null}

Unit tests written for the following cases:
1. cosine_similarity(S, S, S)
2. cosine_similarity(S, E, S)
3. cosine_similarity(N, E, S)
4. cosine_similarity(S, S, E)
5. cosine_similarity(N, N, N)


Thanks,

Nishant Kelkar


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/
-----------------------------------------------------------

(Updated June 28, 2015, 11:29 a.m.)


Review request for hive and Alexander Pivovarov.


Changes
-------

Removed unused code and import statements from TestUDFCosineSimilarity.


Repository: hive-git


Description
-------

1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.


Diffs (updated)
-----

  .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
  ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 

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


Testing
-------


Thanks,

Nishant Kelkar


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/#review89646
-----------------------------------------------------------



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 4)
<https://reviews.apache.org/r/35968/#comment142310>

    Hey Alexander,
    
    I found the following in the ~hive/ql/pom.xml:
    
        <dependency>
           <groupId>org.apache.commons</groupId>
           <artifactId>commons-lang3</artifactId>
           <version>${commons-lang3.version}</version>
        </dependency>
    Looks like we have this dependency?



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 93)
<https://reviews.apache.org/r/35968/#comment142311>

    Oh, I use Java 1.7, so I don't need to mention HashSet<String>. But I'll probably need to, to be backwards compatible with people compiling with Java 1.6.



ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java (line 109)
<https://reviews.apache.org/r/35968/#comment142320>

    Do we usually log such edge cases in Hive? If yes, I could add a slf4j logger to this UDF.


- Nishant Kelkar


On June 28, 2015, 11:22 a.m., Nishant Kelkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35968/
> -----------------------------------------------------------
> 
> (Updated June 28, 2015, 11:22 a.m.)
> 
> 
> Review request for hive and Alexander Pivovarov.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.
> 
> 
> Diffs
> -----
> 
>   .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
>   ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
>   ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35968/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Nishant Kelkar
> 
>


Re: Review Request 35968: 1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.

Posted by Nishant Kelkar <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35968/
-----------------------------------------------------------

(Updated June 28, 2015, 11:22 a.m.)


Review request for hive and Alexander Pivovarov.


Repository: hive-git


Description
-------

1. Added preliminary UDF code for cosine similarity. 2. Added unit tests and integration tests. 3. Registered the UDF in the FunctionRegistry class.


Diffs (updated)
-----

  .reviewboardrc abc33f91a44b76573cbba334c33417307c63956f 
  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java fabc21e2092561cbf98c35a406e4ee40e71fe1de 
  ql/src/java/org/apache/hadoop/hive/ql/udf/UDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFCosineSimilarity.java PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_error_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_1.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_2.q PRE-CREATION 
  ql/src/test/queries/clientnegative/udf_cosine_similarity_wrongargs_3.q PRE-CREATION 
  ql/src/test/queries/clientpositive/udf_cosine_similarity.q PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_error_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_1.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_2.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/udf_cosine_similarity_wrongargs_3.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/show_functions.q.out 5de4ffcd1ace477af026b83fb7bfb8068fc192b3 
  ql/src/test/results/clientpositive/udf_cosine_similarity.q.out PRE-CREATION 

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


Testing
-------


Thanks,

Nishant Kelkar