Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-345

Addition of a genericUDF/reflectUDF

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reviewable
    • Major
    • Resolution: Unresolved
    • 0.5.0
    • Future
    • None
    • None

    Description

      Add genericUDF/reflectUDF that will allow users to use methods from Java directly, instead having to write a UDF wrapper on top of existing Java method.
      Usage:

      SELECT reflect("java.lang.String", "valueOf", 1),
             reflect("java.lang.String", "isEmpty"),
             reflect("java.lang.Math", "max", 2, 3),
             reflect("java.lang.Math", "min", 2, 3),
             reflect("java.lang.Math", "round", 2.5),
             reflect("java.lang.Math", "exp", 1.0),
             reflect("java.lang.Math", "floor", 1.9)
      FROM src LIMIT 1;
      
      1   true    3   2   3   2.7182818284590455  1.0
      

      Attachments

        1. DRILL-345.patch
          8 kB
          Sudheesh Katkam

        Activity

          People

            mehant Mehant Baid
            yash360@gmail.com Yash Sharma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: