----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/24345/#review49840 -----------------------------------------------------------
exec/java-exec/src/main/codegen/data/NumericTypes.tdd <https://reviews.apache.org/r/24345/#comment87230> You don't have to generate functions for nullable data types since you are using NULL_IF_NULL annotation in your function template. exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java <https://reviews.apache.org/r/24345/#comment87231> If its already a numeric data type (int, bigint, float4 ...) you don't have to convert it to string, apply the regex etc. You can simply return 1. - Mehant Baid On Aug. 5, 2014, 9:54 p.m., Yash Sharma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/24345/ > ----------------------------------------------------------- > > (Updated Aug. 5, 2014, 9:54 p.m.) > > > Review request for drill, Aditya Kishore and Mehant Baid. > > > Repository: drill-git > > > Description > ------- > > Implemented Drill Function IsNumeric for DRILL-1141 > > > Diffs > ----- > > exec/java-exec/src/main/codegen/config.fmpp ff6135d > exec/java-exec/src/main/codegen/data/NumericTypes.tdd f37a3dd > exec/java-exec/src/main/codegen/templates/NumericFunctionsTemplates.java > PRE-CREATION > > exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewMathFunctions.java > 62a224e > exec/java-exec/src/test/resources/functions/testIsNumericFunction.json > PRE-CREATION > > Diff: https://reviews.apache.org/r/24345/diff/ > > > Testing > ------- > > Yes. > > > Test Case: > > $mvn test -Dtest=TestNewMathFunctions#testIsNumeric > > Sqlline Test: > > 0: jdbc:drill:zk=local> SELECT employee_id, isnumeric(employee_id) > isnumeric_1, first_name, isnumeric(first_name) isnumeric_2 FROM > cp.`employee.json` limit 10; > > +-------------+-------------+------------+-------------+ > | employee_id | isnumeric_1 | first_name | isnumeric_2 | > +-------------+-------------+------------+-------------+ > | 1 | 1 | Sheri | 0 | > | 2 | 1 | Derrick | 0 | > | 4 | 1 | Michael | 0 | > | 5 | 1 | Maya | 0 | > | 6 | 1 | Roberta | 0 | > | 7 | 1 | Rebecca | 0 | > | 8 | 1 | Kim | 0 | > | 9 | 1 | Brenda | 0 | > | 10 | 1 | Darren | 0 | > | 11 | 1 | Jonathan | 0 | > +-------------+-------------+------------+-------------+ > 10 rows selected (0.451 seconds) > > > Thanks, > > Yash Sharma > >
