hivemall-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myui <...@git.apache.org>
Subject [GitHub] incubator-hivemall issue #135: [WIP] Merge Brickhouse functions
Date Thu, 05 Apr 2018 11:20:09 GMT
Github user myui commented on the issue:

    https://github.com/apache/incubator-hivemall/pull/135
  
    ```sql
    create temporary function array_slice as 'hivemall.tools.array.ArraySliceUDF';
    
    select 
      array_slice(
       array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten"),
       0, -- offset
       2 -- length
      ),
      array_slice(
       array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten"),
       6, -- offset
       3 -- length
      ),
      array_slice(
       array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten"),
       6, -- offset
       10 -- length
      ),
      array_slice(
       array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten"),
       6 -- offset
      ),
      array_slice(
       array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten"),
       -3 -- offset
      ),
      array_slice(
       array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
"ten"),
       -3, -- offset
       2 -- length
      );
    ```
    
    > ["zero","one"]  ["six","seven","eight"] ["six","seven","eight","nine","ten"]    ["six","seven","eight","nine","ten"]
   ["eight","nine","ten"]  ["eight","nine"]


---

Mime
View raw message