[HIVEMALL-289] Add str_contain(string str, array<string> match, boolean or=true) UDF
authorMakoto Yui <myui@apache.org>
Thu, 26 Dec 2019 07:48:02 +0000 (16:48 +0900)
committerMakoto Yui <myui@apache.org>
Thu, 26 Dec 2019 07:48:02 +0000 (16:48 +0900)
commite57bad76a849119eaac4aca3a5e579468f47c614
tree0960b366b668e5266cbe6ccaa7776612346b8ce7
parent2d9050e9b17c54b39e9a99b222f0d9f1beb44ea3
[HIVEMALL-289] Add str_contain(string str, array<string> match, boolean or=true) UDF

## What changes were proposed in this pull request?

Add str_contain(string str, array<string> match, boolean or=true) UDF

## What type of PR is it?

Feature

## What is the Jira issue?

https://issues.apache.org/jira/browse/HIVEMALL-289

## How was this patch tested?

manual tests on EMR

## How to use this feature?

```sql
select
  str_contains('There are apple and orange', array('apple')),
  str_contains('There are apple and orange', array('apple', 'banana'), true),
  str_contains('There are apple and orange', array('apple', 'banana'), false);
> true, true, false
```

## Checklist

- [x] Did you apply source code formatter, i.e., `./bin/format_code.sh`, for your commit?
- [x] Did you run system tests on Hive (or Spark)?

Author: Makoto Yui <myui@apache.org>

Closes #225 from myui/HIVEMALL-289.
ChangeLog.md
core/src/main/java/hivemall/tools/strings/StrContainsUDF.java [new file with mode: 0644]
core/src/main/java/hivemall/utils/hadoop/HiveUtils.java
resources/ddl/define-all-as-permanent.hive
resources/ddl/define-all.hive
resources/ddl/define-all.spark
tools/hivemall-docs/src/main/java/hivemall/docs/FuncsListGeneratorMojo.java