Giter Site home page Giter Site logo

groupconcatwithsorting's Introduction

GroupConcatWithSorting

This is a hive udaf that helps do a concat on one column ordered by another column. The delimiter to be used in concat has to be passed in the function. A sample query looks like below:

select eid, base64(encode(group_concat_with_sorting(id,name,"\n"), 'utf-8')) from testorder group by eid;

Here eid is used to group the rows, all the names are concatinated in with new line as the delimiter. The order of names depends upon the value of id. Here base64 encoding is used so that the new lines may not cause distruption of layout in the hive table. Syntax of the function is:

group_concat_with_sorting(column_for_ordering_must_be_integer,column_for_concat,delimiter); hive-exec-1.1.0 jar has to be in the build path while creating the udaf jar

Sample command to create the temporary function:

create temporary function group_concat_with_sorting() as 'com.hiveudaf.groupconcat.GroupConcatWithSort';

groupconcatwithsorting's People

Contributors

ashish1304 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.