SlideShare uma empresa Scribd logo
1 de 53
2019 HPCC
Systems®
Community Day
Challenge Yourself –
Challenge the Status Quo
Dapper – A Bundle to Make Your ECL NeaterRob Mansfield
Senior Data Scientist
Proagrica
Please ask questions!
Dapper – A Bundle to Make Your ECL Neater
Who thinks ECL
can be a little
verbose?
Engineers on big projects may need this level of control. But.
QAs Analysts
Developers
Data
Scientist
For these people, ECL syntax is a bit of a trial!
Dedup
• DEDUP(SORT(DISTRIBUTE(x, HASH(y)), x, LOCAL), x, LOCAL);
One column transform
• PROJECT(x, TRANSFORM(RECORDOF(LEFT), SELF.y := LEFT.y+1; SELF := LEFT;);
Named output
• OUTPUT(x, NAMED('x'));
Write to CSV
• OUTPUT(x, , '~ROB::TEMP::x', CSV(HEADING(SINGLE), SEPARATOR(','), TERMINATOR('n'),
QUOTE('"')));
Grouped count
• [I ran out of space]
Dapper – A Bundle to Make Your ECL Neater
How does this stuff work in other languages? Well, R is nice!
library(dplyr)
df <- read.csv('x')
df <- select(df, col1, col2)
df <- mutate(df, col3 = col1 +
col2)
df <- group_by(df, col3)
df <- summarise(df, col5 = n())
write.csv(df, file='output.csv')
Dapper – A Bundle to Make Your ECL Neater
How does this stuff work in other languages? Well, R is nice!
library(dplyr)
df <-
read.csv('x') %>%
select(col1, col2) %>%
mutate(col3 = col1 + col2)
%>%
group_by(col3) %>%
summarise(col5 = n()) %>%
write.csv(file='output.csv')
Dapper – A Bundle to Make Your ECL Neater
SQL is also lovely, but can be hard to arrange into a single call
SELECT COUNT(col2), col1 FROM TABLE GROUP BY
col1;
Dapper – A Bundle to Make Your ECL Neater
….and Python is, as always, Python
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
…
Dapper – A Bundle to Make Your ECL Neater
Enter Dapper…
Dapper – A Bundle to Make Your ECL Neater
Let’s work through an example
I don’t know about you but I’ve always wanted to know
Jabba the Hutt’s Body Mass Index…
Load Data
IMPORT dapper.ExampleData;
IMPORT dapper.TransformTools as tt;
Dapper – A Bundle to Make Your ECL Neater
View Data
//load data
StarWars :=
ExampleData.starwars;
// Look at the data
tt.nrows(StarWars);
tt.head(StarWars);
Dapper – A Bundle to Make Your ECL Neater
Dapper – A Bundle to Make Your ECL Neater
//Fill blank species with unknown
fillblankHome := tt.mutate(StarWars, species, IF(species = '', 'Unkn.', species));
tt.head(fillblankHome);
Fill in some blanks
Dapper – A Bundle to Make Your ECL Neater
That’s right, we don’t need LEFT or SELF!!!
What sorcery is this?!?!?
Dapper – A Bundle to Make Your ECL Neater
Okay, we now need to make our BMI column!
//make height meters
heightMeters := tt.mutate(fillblankHome, height, height/100);
//Create a BMI for each character
bmi := tt.append(heightMeters, REAL, BMI, mass/(height^2));
//Look at just the new column and name
bmiSelect := tt.select(bmi, 'name, bmi');
tt.head(bmiSelect);
Dapper – A Bundle to Make Your ECL Neater
Let's work through an example
Sort!
//Find the highest
sortedBMI := tt.arrange(bmiSelect, '-bmi');
tt.head(sortedBMI);
Dapper – A Bundle to Make Your ECL Neater
Lovely, I feel that’s
one of life’s great
questions
answered
I do of course
have other
questions on Star
Wars
Has anyone else noticed the lack of diversity in the SW
universe?
//How many of each species are there?
species := tt.countn(sortedBMI, 'species');
sortedspecies := tt.arrange(species, '-n');
tt.head(sortedspecies);
Dapper – A Bundle to Make Your ECL Neater
There are some pretty exciting eye colours though!
//Finally let's look at unique hair/eye colour combinations:
colourData := tt.select(StarWars, 'eye_color');
unqiueColours := tt.distinct(colourData, 'eye_color');
//see arrangedistinct() for fancy sort/dedup
tt.head(unqiueColours);
Dapper – A Bundle to Make Your ECL Neater
Let's work through an example
Save
//and save our results
tt.to_csv(sortedBMI, 'ROB::TEMP::STARWARSCSV');
tt.to_thor(sortedBMI, 'ROB::TEMP::STARWARS');
Dapper – A Bundle to Make Your ECL Neater
Let’s do a quick
side-by-side
IMPORT dapper.ExampleData;
IMPORT dapper.TransformTools as tt;
//load data
StarWars := ExampleData.starwars;
// Look at the data
tt.nrows(StarWars);
tt.head(StarWars);
//Fill blank species with unknown
fillblankHome := tt.mutate(StarWars, species, IF(species = '', 'Unkn.',
species));
tt.head(fillblankHome);
//Create a BMI for each character
bmi := tt.append(fillblankHome, REAL, BMI, mass/height^2);
tt.head(bmi);
//Find the highest
sortedBMI := tt.arrange(bmi, '-bmi');
tt.head(sortedBMI);
//Jabba should probably go on a diet.
Dapper IMPORT dapper.ExampleData;
//load data
StarWars := ExampleData.starwars;
// Look at the data
OUTPUT(COUNT(StarWars), NAMED('COUNTstarWars'));
OUTPUT(StarWars, NAMED('starWars'));
//Fill blank species with unknown
//Create a BMI for each character
fillblankHomeAndBMI :=
PROJECT(StarWars,
TRANSFORM({RECORDOF(LEFT); REAL BMI;},
SELF.BMI := LEFT.mass / LEFT.Height^2;
SELF.species := IF(LEFT.species = '', 'Unkn.', LEFT.species);
SELF := LEFT;));
OUTPUT(fillblankHomeAndBMI, NAMED('fillblankHomeAndBMI'));
//Find the highest
sortedBMI := SORT(fillblankHomeAndBMI, -bmi);
OUTPUT(sortedBMI, NAMED('sortedBMI'));
//Jabba should probably go on a diet.
Base ECL
Dapper – A Bundle to Make Your ECL Neater
//How many of each species are there?
species := tt.countn(sortedBMI, 'species');
sortedspecies := tt.arrange(species, '-n');
tt.head(sortedspecies);
//Finally let's look at eye colour :
colourData := tt.select(StarWars, 'eye_color');
unqiueColours := tt.distinct(colourData, 'eye_color');
//see arrangedistinct() for fancy sort/dedup
tt.head(unqiueColours);
//and save our results
tt.to_csv(sortedBMI,
'ROB::TEMP::STARWARSCSV');
//How many of each species are there?
CountRec := RECORD
STRING Species := sortedBMI.species;
INTEGER n := COUNT(GROUP);
END;
species := TABLE(sortedBMI, CountRec, species);
sortedspecies := SORT(species, -n);
OUTPUT(sortedspecies, NAMED('sortedspecies'));
//Finally let's look at unique eye colour:
colourData := TABLE(sortedBMI, {eye_color});
unqiueColours := DEDUP(SORT(DISTRIBUTE(colourData,
HASH(eye_color)),
eye_color, LOCAL), eye_color, LOCAL);
OUTPUT(COUNT(unqiueColours), NAMED('COUNTunqiueColours'));
OUTPUT(unqiueColours, NAMED('unqiueColours'));
//and save our results
OUTPUT(sortedBMI, , 'ROB::TEMP::STARWARSCSV',
CSV(HEADING(SINGLE), SEPARATOR(','),
TERMINATOR('n'), QUOTE('"')));
Dapper
Base ECL
Dapper – A Bundle to Make Your ECL Neater
…and we still haven’t even scratched the surface…
Interested? You can install from our GitHub:
ecl bundle install https://github.com/OdinProAgrica/dapper.git
There’s also a more in-depth walkthrough (and infographic)
here:
https://hpccsystems.com/blog/dapper-bundle
Similar projects? Yes, yes we have!
https://github.com/OdinProAgrica
Dapper – A Bundle to Make Your ECL Neater
Bonus deck! We would like to introduce you to hpycc
Dapper – A Bundle to Make Your ECL Neater
Hpycc is a Python package that builds on the ideas of Dapper
That is:
How can we make HPCC Systems more useable to the Data Scientist?
How can this translate to engineering and development?
Dapper – A Bundle to Make Your ECL Neater
Things I find overly taxing
• Spraying new data
• Running scripts that I can customise easily
• Getting the results of queries and files
• ECL dev when I’m offsite
Dapper – A Bundle to Make Your ECL Neater
What if you could run all this from a Python notebook?
Now you can!
Dapper – A Bundle to Make Your ECL Neater
For the purposes of this demo I’ve made a throwaway function
Dapper – A Bundle to Make Your ECL Neater
I’m dev-ing locally so I’ll need HPCC Systems running
…then create a connection to my server
Dapper – A Bundle to Make Your ECL Neater
Let’s grab the raw Star Wars dataset…
Dapper – A Bundle to Make Your ECL Neater
What if we have more than one output?
Dapper – A Bundle to Make Your ECL Neater
Dapper – A Bundle to Make Your ECL Neater
Dapper – A Bundle to Make Your ECL Neater
Dapper – A Bundle to Make Your ECL Neater
Dapper – A Bundle to Make Your ECL Neater
Interested? You can install from pypi:
pip install hpycc
There’s also a more info on our github:
Similar projects? Yes, yes we have!
https://github.com/OdinProAgrica
https://github.com/OdinProAgrica/hpycc
Dapper – A Bundle to Make Your ECL Neater
Watch this space for our most recent project: Wally!
Dapper – A Bundle to Make Your ECL Neater
A little flavour of what we have already…
Dapper – A Bundle to Make Your ECL Neater
Interested? You can install from our github:
pip install hpycc
There’s also a more info on our github:
Similar projects? Yes, yes we have!
https://github.com/OdinProAgrica
https://github.com/OdinProAgrica/wally
Dapper – A Bundle to Make Your ECL Neater
Oh, and Dapper
has some string
tools!
…we are also building a stringtools as part of the Dapper
bundle
IMPORT dapper.stringtools as st;
source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion';
target := 'nobody expects the spanish inquisition';
Dapper – A Bundle to Make Your ECL Neater
…we are also building a stringtools as part of the Dapper
bundle
source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion';
target := 'nobody expects the spanish inquisition';
Dapper – A Bundle to Make Your ECL Neater
…we are also building a stringtools as part of the Dapper
bundle
IMPORT STD;
source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion';
target := 'nobody expects the spanish inquisition';
one := TRIM(std.Str.ToLowerCase(source), LEFT, RIGHT);
two := REGEXREPLACE('1', one, 'body');
three := REGEXREPLACE('[^a-z ]', two, '');
four := REGEXREPLACE('mm', three, 'n');
five := REGEXREPLACE('req', four, 'inq');
six := REGEXREPLACE('s+', five, ' ');
six;
Dapper – A Bundle to Make Your ECL Neater
…we are also building a stringtools as part of the Dapper
bundle
IMPORT dapper.stringtools as st;
source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion';
target := 'nobody expects the spanish inquisition';
regexDS := DATASET([
{'1' , 'body'},
{'[^a-z ]', '' },
{'mm' , 'n' },
{'req' , 'inq' },
{'s+' , ' ' }
], {STRING Regex; STRING Repl;});
st.regexLoop(source, regexDS);
target;
Dapper – A Bundle to Make Your ECL Neater
Questions?
Rob Mansfield
Senior Data Scientist
Proagrica, RBI
Rob.Mansfield@proagrica.com
Dapper – A Bundle to Make Your ECL Neater
View this presentation on YouTube:
https://www.youtube.com/watch?v=jOORZdOWnxk&list=PL-
8MJMUpp8IKH5-d56az56t52YccleX5h&index=5&t=0s (20:46)

Mais conteúdo relacionado

Mais procurados

Boston Spark Meetup May 24, 2016
Boston Spark Meetup May 24, 2016Boston Spark Meetup May 24, 2016
Boston Spark Meetup May 24, 2016
Chris Fregly
 
Why hadoop map reduce needs scala, an introduction to scoobi and scalding
Why hadoop map reduce needs scala, an introduction to scoobi and scaldingWhy hadoop map reduce needs scala, an introduction to scoobi and scalding
Why hadoop map reduce needs scala, an introduction to scoobi and scalding
Xebia Nederland BV
 

Mais procurados (20)

Intro to Terraform
Intro to TerraformIntro to Terraform
Intro to Terraform
 
Boston Spark Meetup May 24, 2016
Boston Spark Meetup May 24, 2016Boston Spark Meetup May 24, 2016
Boston Spark Meetup May 24, 2016
 
Rackspace & Akamai vs. Amazon & CloudFront for a Django site
Rackspace & Akamai vs. Amazon & CloudFront for a Django siteRackspace & Akamai vs. Amazon & CloudFront for a Django site
Rackspace & Akamai vs. Amazon & CloudFront for a Django site
 
Spark After Dark 2.0 - Apache Big Data Conf - Vancouver - May 11, 2016
Spark After Dark 2.0 - Apache Big Data Conf - Vancouver - May 11, 2016Spark After Dark 2.0 - Apache Big Data Conf - Vancouver - May 11, 2016
Spark After Dark 2.0 - Apache Big Data Conf - Vancouver - May 11, 2016
 
Why hadoop map reduce needs scala, an introduction to scoobi and scalding
Why hadoop map reduce needs scala, an introduction to scoobi and scaldingWhy hadoop map reduce needs scala, an introduction to scoobi and scalding
Why hadoop map reduce needs scala, an introduction to scoobi and scalding
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
Terraform at Scale - All Day DevOps 2017
Terraform at Scale - All Day DevOps 2017Terraform at Scale - All Day DevOps 2017
Terraform at Scale - All Day DevOps 2017
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
 
Atlanta Spark User Meetup 09 22 2016
Atlanta Spark User Meetup 09 22 2016Atlanta Spark User Meetup 09 22 2016
Atlanta Spark User Meetup 09 22 2016
 
Advanced Apache Spark Meetup: How Spark Beat Hadoop @ 100 TB Daytona GraySor...
Advanced Apache Spark Meetup:  How Spark Beat Hadoop @ 100 TB Daytona GraySor...Advanced Apache Spark Meetup:  How Spark Beat Hadoop @ 100 TB Daytona GraySor...
Advanced Apache Spark Meetup: How Spark Beat Hadoop @ 100 TB Daytona GraySor...
 
Java to Scala: Why & How
Java to Scala: Why & HowJava to Scala: Why & How
Java to Scala: Why & How
 
Spark, Similarity, Approximations, NLP, Recommendations - Boulder Denver Spar...
Spark, Similarity, Approximations, NLP, Recommendations - Boulder Denver Spar...Spark, Similarity, Approximations, NLP, Recommendations - Boulder Denver Spar...
Spark, Similarity, Approximations, NLP, Recommendations - Boulder Denver Spar...
 
Why is My Spark Job Failing? by Sandy Ryza of Cloudera
Why is My Spark Job Failing? by Sandy Ryza of ClouderaWhy is My Spark Job Failing? by Sandy Ryza of Cloudera
Why is My Spark Job Failing? by Sandy Ryza of Cloudera
 
Terraform - Taming Modern Clouds
Terraform  - Taming Modern CloudsTerraform  - Taming Modern Clouds
Terraform - Taming Modern Clouds
 
Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019
 
APIs and Synthetic Biology
APIs and Synthetic BiologyAPIs and Synthetic Biology
APIs and Synthetic Biology
 
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
[Tokyo Scala User Group] Akka Streams & Reactive Streams (0.7)
 
Terraform - The Road to Self-Service
Terraform - The Road to Self-ServiceTerraform - The Road to Self-Service
Terraform - The Road to Self-Service
 
Take Flight - Using Fly with the Play Framework
Take Flight - Using Fly with the Play FrameworkTake Flight - Using Fly with the Play Framework
Take Flight - Using Fly with the Play Framework
 
Terraform AWS modules and some best-practices - May 2019
Terraform AWS modules and some best-practices - May 2019Terraform AWS modules and some best-practices - May 2019
Terraform AWS modules and some best-practices - May 2019
 

Semelhante a Dapper Tool - A Bundle to Make your ECL Neater

Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Jesse Vincent
 
Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...
Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...
Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...
Databricks
 

Semelhante a Dapper Tool - A Bundle to Make your ECL Neater (20)

Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
 
The Essential Perl Hacker's Toolkit
The Essential Perl Hacker's ToolkitThe Essential Perl Hacker's Toolkit
The Essential Perl Hacker's Toolkit
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...
Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...
Microservices and Teraflops: Effortlessly Scaling Data Science with PyWren wi...
 
Sparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With SparkSparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With Spark
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning C
 
Embed--Basic PERL XS
Embed--Basic PERL XSEmbed--Basic PERL XS
Embed--Basic PERL XS
 
Exploitation Crash Course
Exploitation Crash CourseExploitation Crash Course
Exploitation Crash Course
 
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
 
Alpine academy apache spark series #1 introduction to cluster computing wit...
Alpine academy apache spark series #1   introduction to cluster computing wit...Alpine academy apache spark series #1   introduction to cluster computing wit...
Alpine academy apache spark series #1 introduction to cluster computing wit...
 
Intro to Cascading
Intro to CascadingIntro to Cascading
Intro to Cascading
 
03 introduction to graph databases
03   introduction to graph databases03   introduction to graph databases
03 introduction to graph databases
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Weird Plsql
Weird PlsqlWeird Plsql
Weird Plsql
 
Testing and validating distributed systems with Apache Spark and Apache Beam ...
Testing and validating distributed systems with Apache Spark and Apache Beam ...Testing and validating distributed systems with Apache Spark and Apache Beam ...
Testing and validating distributed systems with Apache Spark and Apache Beam ...
 
What we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at BackstopWhat we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at Backstop
 
Perl 5.10
Perl 5.10Perl 5.10
Perl 5.10
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
What we can learn from Rebol?
What we can learn from Rebol?What we can learn from Rebol?
What we can learn from Rebol?
 

Mais de HPCC Systems

Leveraging Intra-Node Parallelization in HPCC Systems
Leveraging Intra-Node Parallelization in HPCC SystemsLeveraging Intra-Node Parallelization in HPCC Systems
Leveraging Intra-Node Parallelization in HPCC Systems
HPCC Systems
 

Mais de HPCC Systems (20)

Natural Language to SQL Query conversion using Machine Learning Techniques on...
Natural Language to SQL Query conversion using Machine Learning Techniques on...Natural Language to SQL Query conversion using Machine Learning Techniques on...
Natural Language to SQL Query conversion using Machine Learning Techniques on...
 
Improving Efficiency of Machine Learning Algorithms using HPCC Systems
Improving Efficiency of Machine Learning Algorithms using HPCC SystemsImproving Efficiency of Machine Learning Algorithms using HPCC Systems
Improving Efficiency of Machine Learning Algorithms using HPCC Systems
 
Towards Trustable AI for Complex Systems
Towards Trustable AI for Complex SystemsTowards Trustable AI for Complex Systems
Towards Trustable AI for Complex Systems
 
Welcome
WelcomeWelcome
Welcome
 
Closing / Adjourn
Closing / Adjourn Closing / Adjourn
Closing / Adjourn
 
Community Website: Virtual Ribbon Cutting
Community Website: Virtual Ribbon CuttingCommunity Website: Virtual Ribbon Cutting
Community Website: Virtual Ribbon Cutting
 
Path to 8.0
Path to 8.0 Path to 8.0
Path to 8.0
 
Release Cycle Changes
Release Cycle ChangesRelease Cycle Changes
Release Cycle Changes
 
Geohashing with Uber’s H3 Geospatial Index
Geohashing with Uber’s H3 Geospatial Index Geohashing with Uber’s H3 Geospatial Index
Geohashing with Uber’s H3 Geospatial Index
 
Advancements in HPCC Systems Machine Learning
Advancements in HPCC Systems Machine LearningAdvancements in HPCC Systems Machine Learning
Advancements in HPCC Systems Machine Learning
 
Docker Support
Docker Support Docker Support
Docker Support
 
Expanding HPCC Systems Deep Neural Network Capabilities
Expanding HPCC Systems Deep Neural Network CapabilitiesExpanding HPCC Systems Deep Neural Network Capabilities
Expanding HPCC Systems Deep Neural Network Capabilities
 
Leveraging Intra-Node Parallelization in HPCC Systems
Leveraging Intra-Node Parallelization in HPCC SystemsLeveraging Intra-Node Parallelization in HPCC Systems
Leveraging Intra-Node Parallelization in HPCC Systems
 
DataPatterns - Profiling in ECL Watch
DataPatterns - Profiling in ECL Watch DataPatterns - Profiling in ECL Watch
DataPatterns - Profiling in ECL Watch
 
Leveraging the Spark-HPCC Ecosystem
Leveraging the Spark-HPCC Ecosystem Leveraging the Spark-HPCC Ecosystem
Leveraging the Spark-HPCC Ecosystem
 
Work Unit Analysis Tool
Work Unit Analysis ToolWork Unit Analysis Tool
Work Unit Analysis Tool
 
Community Award Ceremony
Community Award Ceremony Community Award Ceremony
Community Award Ceremony
 
A Success Story of Challenging the Status Quo: Gadget Girls and the Inclusion...
A Success Story of Challenging the Status Quo: Gadget Girls and the Inclusion...A Success Story of Challenging the Status Quo: Gadget Girls and the Inclusion...
A Success Story of Challenging the Status Quo: Gadget Girls and the Inclusion...
 
Beyond the Spectrum – Creating an Environment of Diversity and Empowerment wi...
Beyond the Spectrum – Creating an Environment of Diversity and Empowerment wi...Beyond the Spectrum – Creating an Environment of Diversity and Empowerment wi...
Beyond the Spectrum – Creating an Environment of Diversity and Empowerment wi...
 
Using High Dimensional Representation of Words (CBOW) to Find Domain Based Co...
Using High Dimensional Representation of Words (CBOW) to Find Domain Based Co...Using High Dimensional Representation of Words (CBOW) to Find Domain Based Co...
Using High Dimensional Representation of Words (CBOW) to Find Domain Based Co...
 

Último

Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
amitlee9823
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
amitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
AroojKhan71
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 

Último (20)

Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 

Dapper Tool - A Bundle to Make your ECL Neater

  • 1. 2019 HPCC Systems® Community Day Challenge Yourself – Challenge the Status Quo Dapper – A Bundle to Make Your ECL NeaterRob Mansfield Senior Data Scientist Proagrica
  • 2. Please ask questions! Dapper – A Bundle to Make Your ECL Neater
  • 3. Who thinks ECL can be a little verbose?
  • 4. Engineers on big projects may need this level of control. But. QAs Analysts Developers Data Scientist
  • 5. For these people, ECL syntax is a bit of a trial! Dedup • DEDUP(SORT(DISTRIBUTE(x, HASH(y)), x, LOCAL), x, LOCAL); One column transform • PROJECT(x, TRANSFORM(RECORDOF(LEFT), SELF.y := LEFT.y+1; SELF := LEFT;); Named output • OUTPUT(x, NAMED('x')); Write to CSV • OUTPUT(x, , '~ROB::TEMP::x', CSV(HEADING(SINGLE), SEPARATOR(','), TERMINATOR('n'), QUOTE('"'))); Grouped count • [I ran out of space] Dapper – A Bundle to Make Your ECL Neater
  • 6. How does this stuff work in other languages? Well, R is nice! library(dplyr) df <- read.csv('x') df <- select(df, col1, col2) df <- mutate(df, col3 = col1 + col2) df <- group_by(df, col3) df <- summarise(df, col5 = n()) write.csv(df, file='output.csv') Dapper – A Bundle to Make Your ECL Neater
  • 7. How does this stuff work in other languages? Well, R is nice! library(dplyr) df <- read.csv('x') %>% select(col1, col2) %>% mutate(col3 = col1 + col2) %>% group_by(col3) %>% summarise(col5 = n()) %>% write.csv(file='output.csv') Dapper – A Bundle to Make Your ECL Neater
  • 8. SQL is also lovely, but can be hard to arrange into a single call SELECT COUNT(col2), col1 FROM TABLE GROUP BY col1; Dapper – A Bundle to Make Your ECL Neater
  • 9. ….and Python is, as always, Python Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. … Dapper – A Bundle to Make Your ECL Neater
  • 10. Enter Dapper… Dapper – A Bundle to Make Your ECL Neater
  • 11. Let’s work through an example I don’t know about you but I’ve always wanted to know Jabba the Hutt’s Body Mass Index…
  • 12. Load Data IMPORT dapper.ExampleData; IMPORT dapper.TransformTools as tt; Dapper – A Bundle to Make Your ECL Neater
  • 13. View Data //load data StarWars := ExampleData.starwars; // Look at the data tt.nrows(StarWars); tt.head(StarWars); Dapper – A Bundle to Make Your ECL Neater
  • 14. Dapper – A Bundle to Make Your ECL Neater
  • 15. //Fill blank species with unknown fillblankHome := tt.mutate(StarWars, species, IF(species = '', 'Unkn.', species)); tt.head(fillblankHome); Fill in some blanks Dapper – A Bundle to Make Your ECL Neater
  • 16. That’s right, we don’t need LEFT or SELF!!! What sorcery is this?!?!? Dapper – A Bundle to Make Your ECL Neater
  • 17. Okay, we now need to make our BMI column! //make height meters heightMeters := tt.mutate(fillblankHome, height, height/100); //Create a BMI for each character bmi := tt.append(heightMeters, REAL, BMI, mass/(height^2)); //Look at just the new column and name bmiSelect := tt.select(bmi, 'name, bmi'); tt.head(bmiSelect); Dapper – A Bundle to Make Your ECL Neater
  • 18. Let's work through an example Sort! //Find the highest sortedBMI := tt.arrange(bmiSelect, '-bmi'); tt.head(sortedBMI); Dapper – A Bundle to Make Your ECL Neater
  • 19. Lovely, I feel that’s one of life’s great questions answered I do of course have other questions on Star Wars
  • 20. Has anyone else noticed the lack of diversity in the SW universe? //How many of each species are there? species := tt.countn(sortedBMI, 'species'); sortedspecies := tt.arrange(species, '-n'); tt.head(sortedspecies); Dapper – A Bundle to Make Your ECL Neater
  • 21. There are some pretty exciting eye colours though! //Finally let's look at unique hair/eye colour combinations: colourData := tt.select(StarWars, 'eye_color'); unqiueColours := tt.distinct(colourData, 'eye_color'); //see arrangedistinct() for fancy sort/dedup tt.head(unqiueColours); Dapper – A Bundle to Make Your ECL Neater
  • 22. Let's work through an example Save //and save our results tt.to_csv(sortedBMI, 'ROB::TEMP::STARWARSCSV'); tt.to_thor(sortedBMI, 'ROB::TEMP::STARWARS'); Dapper – A Bundle to Make Your ECL Neater
  • 23. Let’s do a quick side-by-side
  • 24. IMPORT dapper.ExampleData; IMPORT dapper.TransformTools as tt; //load data StarWars := ExampleData.starwars; // Look at the data tt.nrows(StarWars); tt.head(StarWars); //Fill blank species with unknown fillblankHome := tt.mutate(StarWars, species, IF(species = '', 'Unkn.', species)); tt.head(fillblankHome); //Create a BMI for each character bmi := tt.append(fillblankHome, REAL, BMI, mass/height^2); tt.head(bmi); //Find the highest sortedBMI := tt.arrange(bmi, '-bmi'); tt.head(sortedBMI); //Jabba should probably go on a diet. Dapper IMPORT dapper.ExampleData; //load data StarWars := ExampleData.starwars; // Look at the data OUTPUT(COUNT(StarWars), NAMED('COUNTstarWars')); OUTPUT(StarWars, NAMED('starWars')); //Fill blank species with unknown //Create a BMI for each character fillblankHomeAndBMI := PROJECT(StarWars, TRANSFORM({RECORDOF(LEFT); REAL BMI;}, SELF.BMI := LEFT.mass / LEFT.Height^2; SELF.species := IF(LEFT.species = '', 'Unkn.', LEFT.species); SELF := LEFT;)); OUTPUT(fillblankHomeAndBMI, NAMED('fillblankHomeAndBMI')); //Find the highest sortedBMI := SORT(fillblankHomeAndBMI, -bmi); OUTPUT(sortedBMI, NAMED('sortedBMI')); //Jabba should probably go on a diet. Base ECL Dapper – A Bundle to Make Your ECL Neater
  • 25. //How many of each species are there? species := tt.countn(sortedBMI, 'species'); sortedspecies := tt.arrange(species, '-n'); tt.head(sortedspecies); //Finally let's look at eye colour : colourData := tt.select(StarWars, 'eye_color'); unqiueColours := tt.distinct(colourData, 'eye_color'); //see arrangedistinct() for fancy sort/dedup tt.head(unqiueColours); //and save our results tt.to_csv(sortedBMI, 'ROB::TEMP::STARWARSCSV'); //How many of each species are there? CountRec := RECORD STRING Species := sortedBMI.species; INTEGER n := COUNT(GROUP); END; species := TABLE(sortedBMI, CountRec, species); sortedspecies := SORT(species, -n); OUTPUT(sortedspecies, NAMED('sortedspecies')); //Finally let's look at unique eye colour: colourData := TABLE(sortedBMI, {eye_color}); unqiueColours := DEDUP(SORT(DISTRIBUTE(colourData, HASH(eye_color)), eye_color, LOCAL), eye_color, LOCAL); OUTPUT(COUNT(unqiueColours), NAMED('COUNTunqiueColours')); OUTPUT(unqiueColours, NAMED('unqiueColours')); //and save our results OUTPUT(sortedBMI, , 'ROB::TEMP::STARWARSCSV', CSV(HEADING(SINGLE), SEPARATOR(','), TERMINATOR('n'), QUOTE('"'))); Dapper Base ECL Dapper – A Bundle to Make Your ECL Neater
  • 26. …and we still haven’t even scratched the surface…
  • 27. Interested? You can install from our GitHub: ecl bundle install https://github.com/OdinProAgrica/dapper.git There’s also a more in-depth walkthrough (and infographic) here: https://hpccsystems.com/blog/dapper-bundle Similar projects? Yes, yes we have! https://github.com/OdinProAgrica Dapper – A Bundle to Make Your ECL Neater
  • 28. Bonus deck! We would like to introduce you to hpycc Dapper – A Bundle to Make Your ECL Neater
  • 29. Hpycc is a Python package that builds on the ideas of Dapper That is: How can we make HPCC Systems more useable to the Data Scientist? How can this translate to engineering and development? Dapper – A Bundle to Make Your ECL Neater
  • 30. Things I find overly taxing • Spraying new data • Running scripts that I can customise easily • Getting the results of queries and files • ECL dev when I’m offsite Dapper – A Bundle to Make Your ECL Neater
  • 31. What if you could run all this from a Python notebook? Now you can! Dapper – A Bundle to Make Your ECL Neater
  • 32. For the purposes of this demo I’ve made a throwaway function Dapper – A Bundle to Make Your ECL Neater
  • 33. I’m dev-ing locally so I’ll need HPCC Systems running …then create a connection to my server Dapper – A Bundle to Make Your ECL Neater
  • 34. Let’s grab the raw Star Wars dataset… Dapper – A Bundle to Make Your ECL Neater
  • 35. What if we have more than one output? Dapper – A Bundle to Make Your ECL Neater
  • 36.
  • 37. Dapper – A Bundle to Make Your ECL Neater
  • 38.
  • 39. Dapper – A Bundle to Make Your ECL Neater
  • 40. Dapper – A Bundle to Make Your ECL Neater
  • 41. Dapper – A Bundle to Make Your ECL Neater
  • 42. Interested? You can install from pypi: pip install hpycc There’s also a more info on our github: Similar projects? Yes, yes we have! https://github.com/OdinProAgrica https://github.com/OdinProAgrica/hpycc Dapper – A Bundle to Make Your ECL Neater
  • 43. Watch this space for our most recent project: Wally! Dapper – A Bundle to Make Your ECL Neater
  • 44. A little flavour of what we have already… Dapper – A Bundle to Make Your ECL Neater
  • 45. Interested? You can install from our github: pip install hpycc There’s also a more info on our github: Similar projects? Yes, yes we have! https://github.com/OdinProAgrica https://github.com/OdinProAgrica/wally Dapper – A Bundle to Make Your ECL Neater
  • 46. Oh, and Dapper has some string tools!
  • 47. …we are also building a stringtools as part of the Dapper bundle IMPORT dapper.stringtools as st; source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion'; target := 'nobody expects the spanish inquisition'; Dapper – A Bundle to Make Your ECL Neater
  • 48. …we are also building a stringtools as part of the Dapper bundle source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion'; target := 'nobody expects the spanish inquisition'; Dapper – A Bundle to Make Your ECL Neater
  • 49. …we are also building a stringtools as part of the Dapper bundle IMPORT STD; source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion'; target := 'nobody expects the spanish inquisition'; one := TRIM(std.Str.ToLowerCase(source), LEFT, RIGHT); two := REGEXREPLACE('1', one, 'body'); three := REGEXREPLACE('[^a-z ]', two, ''); four := REGEXREPLACE('mm', three, 'n'); five := REGEXREPLACE('req', four, 'inq'); six := REGEXREPLACE('s+', five, ' '); six; Dapper – A Bundle to Make Your ECL Neater
  • 50. …we are also building a stringtools as part of the Dapper bundle IMPORT dapper.stringtools as st; source := 'No1 e-xp-ec-t-s t809he [S]pammish ReQuIsiTion'; target := 'nobody expects the spanish inquisition'; regexDS := DATASET([ {'1' , 'body'}, {'[^a-z ]', '' }, {'mm' , 'n' }, {'req' , 'inq' }, {'s+' , ' ' } ], {STRING Regex; STRING Repl;}); st.regexLoop(source, regexDS); target; Dapper – A Bundle to Make Your ECL Neater
  • 51. Questions? Rob Mansfield Senior Data Scientist Proagrica, RBI Rob.Mansfield@proagrica.com Dapper – A Bundle to Make Your ECL Neater
  • 52.
  • 53. View this presentation on YouTube: https://www.youtube.com/watch?v=jOORZdOWnxk&list=PL- 8MJMUpp8IKH5-d56az56t52YccleX5h&index=5&t=0s (20:46)