GithubHelp home page GithubHelp logo

gucb1011 / sparksql-udf-poc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from contactsunny/sparksql-udf-poc

0.0 0.0 0.0 17 KB

This is a simple Java program to illustrate the use of User Defined Functions (UDFs) in Apache SparkSql.

License: GNU General Public License v3.0

Java 100.00%

sparksql-udf-poc's Introduction

SparkSQL UDF POC

This is a simple Java program to illustrate the use of User Defined Functions (UDFs) in Apache SparkSql.

This POC will show you how to register, define, and call a UDF on a dataset. There are examples of how to pass parameters to the UDF as well.

Inputs

As of now, there's only one input as a command line argument to the program. You need to pass the input file path to the program.

Input File

The input file should be a .csv with the columns name and number. A sample is included in the root of the project as an example. The file content is as follows:

name,number
name1,1
name2,2
name3,3
name4,4

The first row of the CSV file will be ignored as it is assumed to be the header.

Running The Project

You need to build the project first before running it. You can build it by running the following command from the root of the project directory:

mvn clean install

After this, run the following command to run the project from the same directory:

java -jar target/SparkSqlUDF-POC-1.0-SNAPSHOT.jar inputFile.csv

sparksql-udf-poc's People

Contributors

contactsunny 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.