Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-24886: Support simple equality operations between MAP/LIST/STRUCT types #2107

Merged
merged 2 commits into from Mar 30, 2021

Conversation

zabetak
Copy link
Contributor

@zabetak zabetak commented Mar 23, 2021

What changes were proposed in this pull request?

  1. Refactor GenericUDFBaseCompare#initialize to allow equalities between
    MAP/LIST/STRUCT types and improve readability.
  2. Add positive and negative parameterized tests for GenericUDF#initialize
    method with various argument types.
  3. Re-work and unify messages in UDFArgumentException when types do not
    match.
  4. Add positive qtests for MAP, LIST, and, STRUCT types and different UDFs.

Why are the changes needed?

  1. Allow simple comparisons between non primitive types.
  2. Avoid unexpected parse and runtime exceptions when performing comparisons involving MAP, LIST, STRUCT types.
  3. Extend test coverage of comparisons operators on STRUCT, LIST, MAP, and primitive types.

Does this PR introduce any user-facing change?

Allows more SQL queries and provides proper failure information when comparisons are not supported.

How was this patch tested?

mvn test -Dtest=TestGenericUDFInitializeOnCompareUDF
mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile="equals_map_types.q,equals_list_types.q,equals_struct_types.q" 

…T types

1. Refactor GenericUDFBaseCompare#initialize to allow equalities between
MAP/LIST/STRUCT types and improve readability.
2. Add positive and negative parameterized tests for GenericUDF#initialize
method with various argument types.
3. Re-work and unify messages in UDFArgumentException when types do not
match.
4. Add positive qtests for MAP, LIST, and, STRUCT types and different UDFs.
@jcamachor jcamachor merged commit b4b353e into apache:master Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants