Spark offers a curious compromise, either you get a un-typed DataFrame API which does some great optimizations with column selection and filtering but gives you almost no guarantees about compile-time type safety. Alternatively, you can use a decent Scala-esque, typesafe-esque Dataset API that has no data-level optimizations at all. Quill-Spark gives you the best of both worlds, and then some! You can query in 100% typesafe way that’s fully optimized, and you get a richer set of joining semantics! What’s more, it’s a simple API that developers can get started with, in minutes, and it’s IDE friendly (and you don’t need to know Shapeless!). Want to learn more?
We will kick off with the basics and then quickly go into how to leverage features like variant types and pattern matching to make impossible states impossible. After you gained some knowledge about the basics the talk will dig even further into ReasonReact.
Devs for Leokz e 7Masters - WTF Oriented ProgrammingFabio Akita
Apresentação que fiz tanto no evento online beneficente Devs for Leokz (https://www.eventials.com/eduardo.shiota/groups/devs-pelo-leokz/) e no 7Masters do Grupo iMasters. Sobre pérolas de programação tosca que encontramos em projetos de verdade mesmo! Aprenda o que NÃO se deve fazer nunca!
Taking Perl to Eleven with Higher-Order FunctionsDavid Golden
Sometimes, you just need your Perl to go one higher. This talk will teach you how to use functions that return functions for powerful, succinct solutions to some repetitive coding problems. Along the way, you’ll see concrete examples using higher-order Perl to generate declarative, structured “fake” data for testing.
An Elephant of a Different Colour: HackVic Metcalfe
Slides from my GTA-PHP Meetup talk about Hack which is the Facebook version of the PHP programming language which runs under their HHVM runtime environment for PHP. The focus of my talk was the language improvements that the Facebook team has added to PHP.
There's a lot of information in the presenter's notes, so if you're interested in Hack scroll down to see the extras.
Build Solutions Not Puzzles - Write Sensible Code. Write code that can clearly communicate your intension. A few guideline and tips for writing readable and maintainable code.
안드로이드 앱 개발시 필요한 여러 기능, 여러분은 어떻게 구현하고 계신가요?
모든 기능을 이태리 장인처럼 한 땀 한 땀 구현할 생각에 고민하고 계시진 않나요?
이제 더 이상 혼자 고민하지 마세요.
전 세계의 개발자들이 모여 만들어가는 오픈소스 라이브러리와 함께라면, 더 이상 혼자가 아닙니다. 여러 사람들의 힘으로 만들어진 라이브러리를 사용하여 원하는 기능을 쉽게 구현하세요.
오픈소스 라이브러리에 필요한 기능이 없나요? 이제 당신이 주인공이 될 차례입니다.
필요한 기능을 추가하여 라이브러리를 향상시키세요!
이 세션에서는 앱 개발시 각 분야별로 유용하게 사용할 수 있는 오픈소스 라이브러리의 종류를 알아보고, 간단한 사용 방법을 알아봅니다.
더불어, 오픈소스 라이브러리에 기여하는 여러 방법에 대해서도 함께 알아봅니다.
GDG DevFest Seoul 2015
2016.11.5
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
We will kick off with the basics and then quickly go into how to leverage features like variant types and pattern matching to make impossible states impossible. After you gained some knowledge about the basics the talk will dig even further into ReasonReact.
Devs for Leokz e 7Masters - WTF Oriented ProgrammingFabio Akita
Apresentação que fiz tanto no evento online beneficente Devs for Leokz (https://www.eventials.com/eduardo.shiota/groups/devs-pelo-leokz/) e no 7Masters do Grupo iMasters. Sobre pérolas de programação tosca que encontramos em projetos de verdade mesmo! Aprenda o que NÃO se deve fazer nunca!
Taking Perl to Eleven with Higher-Order FunctionsDavid Golden
Sometimes, you just need your Perl to go one higher. This talk will teach you how to use functions that return functions for powerful, succinct solutions to some repetitive coding problems. Along the way, you’ll see concrete examples using higher-order Perl to generate declarative, structured “fake” data for testing.
An Elephant of a Different Colour: HackVic Metcalfe
Slides from my GTA-PHP Meetup talk about Hack which is the Facebook version of the PHP programming language which runs under their HHVM runtime environment for PHP. The focus of my talk was the language improvements that the Facebook team has added to PHP.
There's a lot of information in the presenter's notes, so if you're interested in Hack scroll down to see the extras.
Build Solutions Not Puzzles - Write Sensible Code. Write code that can clearly communicate your intension. A few guideline and tips for writing readable and maintainable code.
안드로이드 앱 개발시 필요한 여러 기능, 여러분은 어떻게 구현하고 계신가요?
모든 기능을 이태리 장인처럼 한 땀 한 땀 구현할 생각에 고민하고 계시진 않나요?
이제 더 이상 혼자 고민하지 마세요.
전 세계의 개발자들이 모여 만들어가는 오픈소스 라이브러리와 함께라면, 더 이상 혼자가 아닙니다. 여러 사람들의 힘으로 만들어진 라이브러리를 사용하여 원하는 기능을 쉽게 구현하세요.
오픈소스 라이브러리에 필요한 기능이 없나요? 이제 당신이 주인공이 될 차례입니다.
필요한 기능을 추가하여 라이브러리를 향상시키세요!
이 세션에서는 앱 개발시 각 분야별로 유용하게 사용할 수 있는 오픈소스 라이브러리의 종류를 알아보고, 간단한 사용 방법을 알아봅니다.
더불어, 오픈소스 라이브러리에 기여하는 여러 방법에 대해서도 함께 알아봅니다.
GDG DevFest Seoul 2015
2016.11.5
Everything you always wanted to know about forms* *but were afraid to askAndrea Giuliano
La componente dei Form di Symfony2 rende possibile la costruzione di diverse tipologie di form in modo del tutto semplice. La sua architettura flessibile e altamente scalabile permette di poter gestire strutture adatte ad ogni tipo di esigenza. Tuttavia, conoscere come utilizzare appieno tutta la sua potenza non è banale. In questo talk verrà trattato in profondità la componente Form di Symfony2, mostrando i suoi meccanismi di base e come utilizzarli per estenderli ed introdurre la propria logica di business, così da costruire form cuciti a misura delle tue necessità.
This session will introduce you to the new Form component in Symfony2. With the new domain-driven paradigma and its flexible design, the component opens a door to a wide range of possibilities. The brand new architecture makes creating complex forms easier and faster than ever before. This talk will teach you today what you need to know to build powerful forms tomorrow.
Reason - introduction to language and its ecosystem | Łukasz StrączyńskiGrand Parade Poland
A moderately deep look at new language with OCaml roots. Is there a reason to be hyped about it? Is it mature enough to be considered production ready?
What does it offer over JS, Flow or other compiled to JS languages?
날이 갈수록 쏟아지는 모던 프로그래밍 언어들, 안드로이드 앱 개발자에겐 꿈과 같은 이야기였다고요? 이제는 더 이상 꿈이 아닙니다.
이 세션에서는 구글 I/O 2017에서 안드로이드의 공식 지원 언어로 발표된 코틀린에 대해 간략히 알아보고, 실제 애플리케이션에 적용한 사례를 함께 소개합니다.
Google I/O 2017 Extended Seoul
2017.07.02
Fábio Akita é co-fundador da Codeminer 42, empresa de desenvolvimento de software principalmente para startups. Desde 2008 é o criador e organizador do Rubyconf Brasil, uma das maiores conferências de tecnologia da América Latina. Tem experiência de 20 anos no mercado de software, tendo passado pelo mercado de grandes agências, consultoria SAP corporativo e pelo primeiro boom de startups em 2000. Nesta edição do 7Masters, ele trouxe a talk "WTF Oriented Programming".
Select, Select with Boolean Exp, Select with Numeric Exp, Select with Date Exp, Create database, Drop database, Use database, Create table, Describe table, Drop table, Insert record, Update record(s), Delete record(s), Like clause with Select statement, Top clause with Select Statement, Order By clause with Select Statement, Group By clause with Select Statement, Distinct clause with Select Statement, Default constraint, Identity Property, Unique constraint, Check constraint, Alter Table, Primary Key constraint, Foreign Key constraint, Index, Views, Equi-Join, Natural Join, Cross Join
Sometimes we want to keep or collect errors for later examination. We’ll use Cats to help us pick the story we want to tell when handling errors; accumulated errors or first error wins. Monads will be included!
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
The goal of this talk is to educate developers on common security vulnerabilities, how they are exploited, and how to protect against them. We'll explore several of the OWASP Top 10 attack vectors like SQL injection, XSS, CSRF, session hijacking, and insecure direct object references. Each topic will be approached from the perspective of an attacker to see how these vulnerabilities are detected and exploited using several realistic examples. Once we've established an understanding of how these attacks work, we'll look at concrete steps you can take to secure web applications against such vulnerabilities. The knowledge gained from this talk can also be used for participating in "Capture the Flag" security competitions.
Kotlin is a modern statically typed programming language which was made a first-class language for writing Android Apps by Google in 2017. Since then it has grown into popularity and many apps from hottest startups to 500 fortune companies are built using Kotlin. This talk will deep dive into Kotlin and modern android architecture for writing apps faster and in a better way.
Transducers are a type of reducing function that take in a reducing function and give back another reducing function. They allow you to compose functions together in a chain or pipeline structure to quickly, easily and efficiently transform data. In PHP, we have the mtdowling/transducers library, built off the basis of the idea of Clojure's transducer library.
This session will introduce you to the new Form component in Symfony2. With the new domain-driven paradigma and its flexible design, the component opens a door to a wide range of possibilities. The brand new architecture makes creating complex forms easier and faster than ever before. This talk will teach you today what you need to know to build powerful forms tomorrow.
Reason - introduction to language and its ecosystem | Łukasz StrączyńskiGrand Parade Poland
A moderately deep look at new language with OCaml roots. Is there a reason to be hyped about it? Is it mature enough to be considered production ready?
What does it offer over JS, Flow or other compiled to JS languages?
날이 갈수록 쏟아지는 모던 프로그래밍 언어들, 안드로이드 앱 개발자에겐 꿈과 같은 이야기였다고요? 이제는 더 이상 꿈이 아닙니다.
이 세션에서는 구글 I/O 2017에서 안드로이드의 공식 지원 언어로 발표된 코틀린에 대해 간략히 알아보고, 실제 애플리케이션에 적용한 사례를 함께 소개합니다.
Google I/O 2017 Extended Seoul
2017.07.02
Fábio Akita é co-fundador da Codeminer 42, empresa de desenvolvimento de software principalmente para startups. Desde 2008 é o criador e organizador do Rubyconf Brasil, uma das maiores conferências de tecnologia da América Latina. Tem experiência de 20 anos no mercado de software, tendo passado pelo mercado de grandes agências, consultoria SAP corporativo e pelo primeiro boom de startups em 2000. Nesta edição do 7Masters, ele trouxe a talk "WTF Oriented Programming".
Select, Select with Boolean Exp, Select with Numeric Exp, Select with Date Exp, Create database, Drop database, Use database, Create table, Describe table, Drop table, Insert record, Update record(s), Delete record(s), Like clause with Select statement, Top clause with Select Statement, Order By clause with Select Statement, Group By clause with Select Statement, Distinct clause with Select Statement, Default constraint, Identity Property, Unique constraint, Check constraint, Alter Table, Primary Key constraint, Foreign Key constraint, Index, Views, Equi-Join, Natural Join, Cross Join
Sometimes we want to keep or collect errors for later examination. We’ll use Cats to help us pick the story we want to tell when handling errors; accumulated errors or first error wins. Monads will be included!
Hacking Your Way To Better Security - Dutch PHP Conference 2016Colin O'Dell
The goal of this talk is to educate developers on common security vulnerabilities, how they are exploited, and how to protect against them. We'll explore several of the OWASP Top 10 attack vectors like SQL injection, XSS, CSRF, session hijacking, and insecure direct object references. Each topic will be approached from the perspective of an attacker to see how these vulnerabilities are detected and exploited using several realistic examples. Once we've established an understanding of how these attacks work, we'll look at concrete steps you can take to secure web applications against such vulnerabilities. The knowledge gained from this talk can also be used for participating in "Capture the Flag" security competitions.
Kotlin is a modern statically typed programming language which was made a first-class language for writing Android Apps by Google in 2017. Since then it has grown into popularity and many apps from hottest startups to 500 fortune companies are built using Kotlin. This talk will deep dive into Kotlin and modern android architecture for writing apps faster and in a better way.
Transducers are a type of reducing function that take in a reducing function and give back another reducing function. They allow you to compose functions together in a chain or pipeline structure to quickly, easily and efficiently transform data. In PHP, we have the mtdowling/transducers library, built off the basis of the idea of Clojure's transducer library.
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfarrowit1
***SQL FILE FROM MOODLE***
USE [master]
GO
/****** Object: Database [PVF] Script Date: 6/17/2013 1:07:19 PM ******/
CREATE DATABASE [PVF]
ALTER DATABASE [PVF] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY(\'IsFullTextInstalled\'))
begin
EXEC [PVF].[dbo].[sp_fulltext_database] @action = \'enable\'
end
GO
ALTER DATABASE [PVF] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [PVF] SET ANSI_NULLS OFF
GO
ALTER DATABASE [PVF] SET ANSI_PADDING OFF
GO
ALTER DATABASE [PVF] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [PVF] SET ARITHABORT OFF
GO
ALTER DATABASE [PVF] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [PVF] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [PVF] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [PVF] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [PVF] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [PVF] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [PVF] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [PVF] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [PVF] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [PVF] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [PVF] SET DISABLE_BROKER
GO
ALTER DATABASE [PVF] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [PVF] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [PVF] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [PVF] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [PVF] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [PVF] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [PVF] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [PVF] SET RECOVERY SIMPLE
GO
ALTER DATABASE [PVF] SET MULTI_USER
GO
ALTER DATABASE [PVF] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [PVF] SET DB_CHAINING OFF
GO
ALTER DATABASE [PVF] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [PVF] SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
ALTER DATABASE [PVF] SET READ_WRITE
GO
USE [PVF]
CREATE TABLE Customer_T
(CustomerID NUMERIC(11,0) NOT NULL,
CustomerName VARCHAR(25) NOT NULL,
CustomerAddress VARCHAR(30) ,
CustomerCity VARCHAR(20) ,
CustomerState CHAR(2) ,
CustomerPostalCode VARCHAR(10) ,
CONSTRAINT Customer_PK PRIMARY KEY (CustomerID));
CREATE TABLE Territory_T
(TerritoryID NUMERIC(11,0) NOT NULL,
TerritoryName VARCHAR(50) ,
CONSTRAINT Territory_PK PRIMARY KEY (TerritoryID));
CREATE TABLE DoesBusinessIn_T
(CustomerID NUMERIC(11,0) NOT NULL,
TerritoryID NUMERIC(11,0) NOT NULL,
CONSTRAINT DoesBusinessIn_PK PRIMARY KEY (CustomerID, TerritoryID),
CONSTRAINT DoesBusinessIn_FK1 FOREIGN KEY (CustomerID) REFERENCES
Customer_T(CustomerID),
CONSTRAINT DoesBusinessIn_FK2 FOREIGN KEY (TerritoryID) REFERENCES
Territory_T(TerritoryID));
CREATE TABLE Employee_T
(EmployeeID VARCHAR(10) NOT NULL,
EmployeeName VARCHAR(25) ,
EmployeeAddress VARCHAR(30) ,
EmployeeBirthDate DATE ,
EmployeeCity VARCHAR(20) ,
EmployeeState CHAR(2) ,
EmployeeZipCode VARCHAR(10) ,
EmployeeDateHired DATE ,
EmployeeSupervisor VARCHAR(10) ,
CONSTRAINT Employee_PK PRIMARY KEY (EmployeeID));
CREATE TABLE Skill_T
(SkillID VARCHAR(12) NOT NULL,
SkillDescription.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
5. So What’s The Difference?
• Abstraction
• Encapsulation
• Error Handling
• Good Control Flow
• Performance
Application Development
Languages
Data Retrieval
Languages
• Natural Expression
• Possible Optimization
• Good Control Flow
• Performance
6. They Make Different Tradeoffs!
AbstractionPower
Possible Optimizations
Data Retrieval
Languages
Application Development
Languages
7. Example Please???
CREATE VIEW HelloAmerican AS
SELECT 'Hello ' || t.firstName + ' ' || t.lastName + ' of ' || a.city
FROM Americans t
JOIN Addresses a on t.address_id == a.id
-- Hello John James of New York
CREATE VIEW HelloCanadian AS
SELECT 'Hello ' + t.name + ' ' + t.surname + ' of ' + a.city
FROM Canadians t
JOIN Addresses a on t.residence_id == a.id
-- Hello Jim Jones of Toronto
CREATE VIEW HelloYeti AS
SELECT 'Hello ' + t.gruntingSound + ' ' + t.roaringSound + ' of ' + a.city
FROM AbominableShowmen t
JOIN Addresses a on t.cave_id == a.id
-- Hello Aaargalah Gralala of Kholat Syakhl
8. CREATE FUNCTION AddressToSomeone (
@humanoidLivingSomewhere Table(called VARCHAR; alsoCalled VARCHAR; whereHeLives_id)
)
SELECT 'Hello ' || t.called || ' ' || t.alsoCalled || ' of ' || a.city
FROM @humanoidLivingSomewhere t
JOIN Addresses a on t.whereHeLives_id == a.id
CREATE VIEW AmericanClients
AS SELECT * from AddressToSomeone(
SELECT t.firstName as called, t.lastName as alsoCalled, a.address_id as whereHeLives_id
FROM Americans
)
CREATE VIEW CanadianClients
AS SELECT * from AddressToSomeone(
SELECT t.name as called, t.surname as alsoCalled, a.residence_id as whereHeLives_id
FROM Canadians
)
CREATE VIEW YetiClients
AS SELECT * from AddressToSomeone(
SELECT t.gruntingSound as called, t.roaringSound as alsoCalled,
a.cave_id as whereHeLives_id
FROM AbominableShowmen
)
9. CREATE FUNCTION concatName (
@called VARCHAR; @alsoCalled VARCHAR; @whereHeLives_id)
)
AS 'Hello ' || t.called || ' ' || t.alsoCalled || ' of ' || a.city
SELECT concatName(t.firstName, t.lastName, a.city)
FROM American t
JOIN Addresses a on t.whereHeLives_id == a.id
SELECT concatName(t.name, t.surname, a.city)
FROM American t
JOIN Addresses a on t.whereHeLives_id == a.id
SELECT concatName(t.gruntingSound, t.roaringSound, a.city)
FROM American t
JOIN Addresses a on t.whereHeLives_id == a.id
10. CREATE FUNCTION concatName (
@called VARCHAR; @alsoCalled VARCHAR; @whereHeLives_id)
)
AS 'Hello ' || t.called || ' ' || t.alsoCalled || ' of ' || a.city
CREATE FUNCTION AddressToSomeone (
@humanoidLivingSomewhere Table(called VARCHAR; alsoCalled VARCHAR;
whereHeLives_id)
)
SELECT
'Hello ' ||t .called || ' ' || t.alsoCalled || ' of ' || a.city,
CASE
WHEN zd.zone_type = 'K' THEN 'StandardCategory'
WHEN zd.zone_type = 'N' AND rc.barbaz = 'GT' THEN 'NonStandardCategory'
ELSE 'UnknownCategory'
END as zoning_category1,
CASE
WHEN ru.kdd = 'IK' THEN 'Insanity'
WHEN zd.kdd = 'N' AND rc.barbaz = 'GTT' THEN 'MoreInsanity'
ELSE 'I_Dont_Even_Know_What_Goes_Here'
END as zoning_category2
FROM @humanoidLivingSomewhere t
JOIN Addresses a on t.whereHeLives_id = a.id
JOIN ResidenceUnit ru on a.rid = ru.id
JOIN ResidenceClass rc on ru.class_id = rc.class_id
JOIN ZoningDesignation zd on ru.zone_id = zd.rzid and zd.cid = rc.class_id
SELECT concatName(t.firstName, t.lastName, a.city)
FROM American t
JOIN Addresses a on t.whereHeLives_id == a.id
SELECT concatName(t.name, t.surname, a.city)
FROM American t
JOIN Addresses a on t.whereHeLives_id == a.id
SELECT concatName(t.gruntingSound, t.roaringSound, a.city)
FROM American t
JOIN Addresses a on t.whereHeLives_id == a.id
11. CREATE FUNCTION AddressToSomeone (
@humanoidLivingSomewhere Table(called VARCHAR; alsoCalled VARCHAR; whereHeLives_id)
)
SELECT 'Hello ' || t.called || ' ' || t.alsoCalled || ' of ' || a.city
FROM @humanoidLivingSomewhere t
JOIN Addresses a on t.whereHeLives_id == a.id
12. CREATE FUNCTION AddressToSomeone (
@humanoidLivingSomewhere Table(called VARCHAR; alsoCalled VARCHAR; whereHeLives_id)
)
SELECT 'Hello ' || t.called || ' ' || t.alsoCalled || ' of ' || a.city
FROM @humanoidLivingSomewhere t
JOIN Addresses a on t.whereHeLives_id == a.id
WHERE a.current = true
DataFrame Can!
def addressToSomeone(df: DataFrame) = {
df.as("t")
.join(addresses.as("a"), $"whereHeLivesId" === $"id")
.select(
concat(lit("Hello "), $"t.called", lit(" "), $"t.alsoCalled",
lit(" of "), $"a.city"))
.filter($"a.current" === lit(true))
}
13. DataFrame Can!
addressToSomeone(
americans.select($"firstName" as "called", $"lastName" as "alsoCalled",
$"address_id" as "whereHeLives_id")
)
addressToSomeone(
canadians.select($"name" as "called", $"surname" as "alsoCalled",
$"residence_id" as "whereHeLives_id")
)
addressToSomeone(
yeti.select($"gruntSound" as "called", $"roarSound" as "alsoCalled",
$"cave_id" as "whereHeLives_id")
)
def addressToSomeone(df: DataFrame) = {
df.as("t")
.join(addresses.as("a"), $"id" === $"whereHeLives_id")
.select(
concat(lit("Hello "), $"t.called", lit(" "), $"t.alsoCalled",
lit(" of "), $"a.city"))
.filter($"a.current" === lit(true))
}
14. DataFrame Can…
addressToSomeone(
americans.select($"firstName" as "called", $"lastName" as "alsoCalled",
$"address_id" as "whereHeLives_id")
)
addressToSomeone(
canadians.select($"name" as "called", $"surname" as "alsoCalled",
$"residence_id" as "whereHeLives_id")
)
addressToSomeone(
yeti.select($"gruntSound" as "called", $"roarSound" as "alsoCalled",
$"cave_id" as "whereHeLives_id")
)
def addressToSomeone(df: DataFrame) = {
df.as("t")
.join(addresses.as("a"), $"whereHeLives_id" === $"id")
.select(
concat(lit("Hello "), $"t.called", lit(" "), $"t.alsoCalled",
lit(" of "), $"a.city"))
.filter($"a.current" === lit(true))
}
23. def insaneJoin(humanoidsLivingSomewhere: Dataset[HumanoidLivingSomewhere]) =
humanoidsLivingSomewhere.as("t")
.joinWith(addresses.as("a"), $"whereHeLives_id" === $"id")
.joinWith(residenceUnit.as("ru"), $"_2.rid" === $"ru.id")
.joinWith(residenceClass.as("rc"), $"_2.class_id" === $"rc.class_id")
.joinWith(zoningDesignation.as("zd"),
($"_1._2.zone_id" === "zd.rzid") &&
($"zd.cid" === $"_1._2.class_id")
)
.map { case ((((t, a), ru), rc), zd) => (
s"Hello ${t.called} ${t.alsoCalled} of ${a.city}",
if (zd.zone_type == "K") "StandardCategory"
else if (zd.zone_type == "N" && rc.barbaz == "GT")
"NonStandardCategory"
else
"UnknownCategory",
if (ru.kdd == "IK") "Insanity"
else if (zd.kdd == "N" && rc.barbaz == "GT")
"MoreInsanity"
else
"I_Dont_Even_Know_What_Goes_Here"
)
}
24. case class American(
firstName:String, lastName:String, address_id:Int,
irrelevantP1:String... irrelevantP100:String
)
case class Canadian(
name:String, surname:String, residence_id:Int,
irrelevantP1:String... irrelevantP100:String
)
case class Yeti(
gruntingSound:String, roaringSound:String, address_id:Int,
irrelevantP1:String... irrelevantP100:String
)
Say There's Stuff We Don't Care About
case class Address(
id:Int, street:String, city:String, current: Boolean
irrelevantA1:String... irrelevantA100:String
)
case class HumanoidLivingSomewhere(
called:String, alsoCalled: String, whereHeLives_id:Int
)
25. Let's Plug it In!
def addressToSomeone(humanoidLivingSomewhere: DataFrame) = {
humanoidLivingSomewhere.as("t")
.join(addresses.as("a"), $"whereHeLivesId" === $"id")
.select(
concat(lit("Hello "), $"t.called", lit(" "), $"t.alsoCalled", lit(" of "), $"a.city"))
.filter($"a.current" === lit(true))
}
addressToSomeone(
americans.select(
$"firstName" as "called", $"lastName" as "alsoCalled", $"address_id" as "whereHeLives_id")
)
americans
.select($"firstName" as "called", $"lastName" as "alsoCalled", $"address_id" as "whereHeLives_id")
.as("t")
.join(addresses.as("a"), $"whereHeLivesId" === $"id")
.select(
concat(lit("Hello "), $"t.called", lit(" "), $"t.alsoCalled", lit(" of "), $"a.city"))
.filter($"a.current" === lit(true))
29. In English Please?
*(🤞) Gimme My Result! [concat(Hello , called, , alsoCalled, of , city)]
+- *(💂) We're Joining! Huzzah! [whereHeLives_id], [id], Inner
+- Join Key for the Left Side! (whereHeLives_id)
+- *(1) Rename these like I said! Pronto! [firstName as Called... ]
+- *(😇) I'm a smart format, load only: [firstName,lastName,address_id]
+- Join Key for the Right Side! (id)
+- *(😇) I'm a smart format, load only: [id,city,current]
Read only current addr. from the file! 😎: [EqualTo(current,true)],
americans
.select($"firstName" as "called", $"lastName" as "alsoCalled", $"address_id" as "whereHeLives_id")
.as("t")
.join(addresses.as("a"), $"whereHeLivesId" === $"id")
.select(
concat(lit("Hello "), $"t.called", lit(" "), $"t.alsoCalled", lit(" of "), $"a.city"))
.filter($"a.current" === lit(true))
.explain()
30. How About Dataset?
def addressToSomeone(humanoidsLivingSomewhere: Dataset[HumanoidLivingSomewhere]) = {
humanoidsLivingSomewhere
.joinWith(addresses, $"id" === $"whereHeLivesId")
.filter(ta => ta._2.current == true)
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
}
val americanClients =
addressToSomeone(
americans.map(a => HumanoidLivingSomewhere(a.firstName, a.lastName, a.addressId))
)
americans.map(a => HumanoidLivingSomewhere(a.firstName, a.lastName, a.addressId))
.joinWith(addresses, $"id" === $"whereHeLivesId")
.filter(ta => ta._2.current == true)
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
32. *(🤮) Serialize Back Into a String Expensive!
+- *(3) Do the Outer Map that we Invoked
+- (🤮) Deserialize Tuple2 Expensive!
+- & We're Joining! Huzzah! [_1.whereHeLives_id], [_2.id], Inner
+- Join Key for the Left Side (_1.whereHeLives_id)
+- *(1) Project [called, alsoCalled, whereHeLives_id]
+- *(🤮) Serialize the Join Key. Expensive!
+- *(1) MapElements HumanoidLivingSomewhere
+- (🤮) Deserialize into a JVM Object (i.e. class American)
+- Scan All 'American' Columns Including 100 irrelevant ones!😱
+- Join Key for the Right Side (_2.id)
+- Scan All 'Address' Columns Including 100 irrelevant ones! 😱
We Need to Read The Entire Dataset! No Excluding Non-Current Addresses 😢
americans.map(a => HumanoidLivingSomewhere(a.firstName, a.lastName, a.addressId))
.joinWith(addresses, $"id" === $"whereHeLivesId")
.filter(ta => ta._2.current == true)
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
.explain()
33. americans.map(a => HumanoidLivingSomewhere(a.firstName, a.lastName, a.addressId))
.joinWith(addresses, $"id" === $"whereHeLivesId")
.filter(ta => ta._2.current == true)
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
34. val americanClients =
americans.map(a =>
HumanoidLivingSomewhere(a.firstName, a.lastName, a.address_id)
)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { tup => tup._2.current == true }
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
What We See:
What Catalyst Sees:
val americanClients =
americans.map(¯_(ツ)_/¯ : HumanoidLivingSomewhere)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { ¯_(ツ)_/¯ : Boolean }
.map { ¯_(ツ)_/¯ : String }
35. val americanClients =
americans.map(a =>
HumanoidLivingSomewhere(a.firstName, a.lastName, a.address_id)
)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { tup => tup._2.current == true }
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
What We See:
What Catalyst Sees:
val americanClients =
americans.map(¯_(ツ)_/¯ : HumanoidLivingSomewhere)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { ¯_(ツ)_/¯ : Boolean }
.map { ¯_(ツ)_/¯ : String }
Which Columns are
we using in here?
Which Columns are
we using in here?
Which Columns are
we using in here?
⏸
36. val americanClients =
americans.map(a =>
HumanoidLivingSomewhere(a.firstName, a.lastName, a.address_id)
)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { tup => tup._2.current == true }
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
What We See:
What Catalyst Sees:
val americanClients =
americans.map(¯_(ツ)_/¯ : HumanoidLivingSomewhere)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { ¯_(ツ)_/¯ : Boolean }
.map { ¯_(ツ)_/¯ : String }
I Guess We Need
All Of Them!
I Guess We Need
All Of Them!
I Guess We Need
All Of Them!
⏸
37. val americanClients =
americans.map(a =>
HumanoidLivingSomewhere(a.firstName, a.lastName, a.address_id)
)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { tup => tup._2.current == true }
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
What We See:
What Catalyst Sees:
val americanClients =
americans.map(¯_(ツ)_/¯ : HumanoidLivingSomewhere)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { ¯_(ツ)_/¯ : Boolean }
.map { ¯_(ツ)_/¯ : String }
38. val americanClients =
americans.map(a =>
HumanoidLivingSomewhere(a.firstName, a.lastName, a.address_id)
)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { tup => tup._2.current == true }
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
What We See:
What Catalyst Sees:
val americanClients =
americans.map(¯_(ツ)_/¯ : HumanoidLivingSomewhere)
.joinWith(addresses, ¯_(ツ)_/¯)
.filter { ¯_(ツ)_/¯ : Boolean }
.map { ¯_(ツ)_/¯ : String }
⏸
What columns
am I joining by???
39. val americanClients =
americans.map(a =>
HumanoidLivingSomewhere(a.firstName, a.lastName, a.address_id)
)
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { tup => tup._2.current == true }
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
What We See:
What Catalyst Sees:
val americanClients =
americans.map( (🖼 American) => HumanoidLivingSomewhere 🖼 ) 🤮
.joinWith(addresses, $"whereHeLives_id" === $"id")
.filter { (🖼 HumanoidLivingSomewhere) => Boolean } 🤮
.map { (🖼 HumanoidLivingSomewhere) => String 🖼 } 🤮
→ →
→
→ →
40. americans.map(a => HumanoidLivingSomewhere(a.firstName, a.lastName, a.addressId))
.joinWith(addresses, $"id" === $"whereHeLivesId")
.filter(ta => ta._2.current == true)
.map { case (t, a) => s"Hello ${t.called} ${t.alsoCalled} of ${a.city}" }
41. def addressToSomeone(humanoid: TypedDataset[HumanoidLivingSomewhere]) = {
val joined = humanoid
.joinInner(addresses) { humanoid('where) === addresses('id) }
joined.select(concat(
lit("Hello "), joined.colMany('_1, 'called), lit(" "),
joined.colMany('_1, 'alsoCalled), lit(" of "), joined.colMany('_2, 'city)))
}
What About Frameless?
addressToSomeone(
americans.select(americans('firstName), americans('lastName), americans('addressId))
.deserialized.map{ case (name, age, whereHeLives_id ) =>
HumanoidLivingSomewhere(
name.asInstanceOf[String],
age.asInstanceOf[String],
whereHeLives_id.asInstanceOf[Int])
}
)
42. What About Frameless?
def addressToSomeone(humanoid: TypedDataset[HumanoidLivingSomewhere]) = {
val joined = humanoid
.joinInner(addresses) { humanoid('where) === addresses('id) }
joined.select(concat(
lit("Hello "), joined.colMany('_1, 'called), lit(" "),
joined.colMany('_1, 'alsoCalled), lit(" of "), joined.colMany('_2, 'city)))
}
addressToSomeone(
americans.select(americans('firstName), americans('lastName), americans('addressId))
.deserialized.map{ case (name, age, whereHeLives_id ) =>
HumanoidLivingSomewhere(
name.asInstanceOf[String],
age.asInstanceOf[String],
whereHeLives_id.asInstanceOf[Int])
}
)
43. What About Frameless?
def addressToSomeone(humanoid: TypedDataset[HumanoidLivingSomewhere]) = {
val joined = humanoid
.joinInner(addresses) { humanoid('where) === addresses('id) }
joined.select(concat(
lit("Hello "), joined.colMany('_1, 'called), lit(" "),
joined.colMany('_1, 'alsoCalled), lit(" of "), joined.colMany('_2, 'city)))
}
47. [error] found : frameless.TypedColumn[Nothing,String]
[error] required:
frameless.AbstractTypedColumn[((((org.ctl.complex.HumanoidLivingSomewhere,
org.ctl.complex.Address), org.ctl.complex.ResidenceUnit),
org.ctl.complex.ResidenceClass), org.ctl.complex.ZoningDesignation),String]
[error] Note: Nothing <: ((((org.ctl.complex.HumanoidLivingSomewhere,
org.ctl.complex.Address), org.ctl.complex.ResidenceUnit),
org.ctl.complex.ResidenceClass), org.ctl.complex.ZoningDesignation), but class
AbstractTypedColumn is invariant in type T.
[error] You may wish to define T as +T instead. (SLS 4.5)
[error] when(j4.colMany('_2, 'zone_type) === "K", lit("StandardCategory"))
48. DataFrame/SQL Untyped 😢
Column Pruning
Filter Pushdown 😎
Dataset Almost Typed 😕 Extra Serialization 🤮
Frameless Typed 😃
Very Complex if you
don't know Shapeless.
58. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[?]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
59. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
60. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield ( )
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
Query [Humanoid]
Humanoid
Query [Address]
Address
⏸
61. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
62. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
63. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses if (
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
64. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
65. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
LEFT JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.leftJoin(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
66. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
LEFT JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.leftJoin(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
Address
67. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
LEFT JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.leftJoin(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
Address
Option[Address] Address
68. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
69. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == trueString
70. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Query[String]
71. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Query[Humanoid] => Query[String]
Query[String]
72. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Quoted[Query[Humanoid] => Query[String]]
Query[Humanoid] => Query[String]
Query[String]
73. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield h
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
h.*
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Quoted[Query[Humanoid] => Query[Humanoid]]
Query[Humanoid] => Query[Humanoid]
Query[Humanoid]
74. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield a
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
a.*
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Quoted[Query[Humanoid] => Query[Address]]
Query[Humanoid] => Query[Address]
Query[Address]
75. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (h, a)
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
h.*, a.*
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Quoted[Query[Humanoid] => Query[(Humanoid, Address)]]
Query[Humanoid] => Query[(Humanoid, Address)]
Query[(Humanoid, Address)]
76. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (Foobar(h, a))
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
?? I don't understand objects ??
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
Quoted[Query[Humanoid] => Query[Foobar]]
Query[Humanoid] => Query[Foobar]
Query[Foobar]
77. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
▶
78. for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
79. for {
h <- humanoid
a <- addresses.join(a => a.id == h.whereHeLives_id)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
80. for {
h <- humanoid
a <- addresses.join(a => a.id == h.whereHeLives_id)
ru <-residenceUnit.join(ru => a.rid == ru.id)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
81. for {
h <- humanoid
a <- addresses.join(a => a.id == h.whereHeLives_id)
ru <-residenceUnit.join(ru => a.rid == ru.id)
rc <- residenceClass.join(rc => ru.class_id == rc.class_id)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
93. for {
h <- humanoid
a <- addresses.join(a => a.id == h.whereHeLives_id)
ru <-residenceUnit.join(ru => a.rid == ru.id)
rc <- residenceClass.join(rc => ru.class_id == rc.class_id)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
94. for {
h <- humanoid
a <- addresses.join(a => a.id == h.whereHeLives_id)
ru <-residenceUnit.join(ru => a.rid == ru.id)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
95. for {
h <- humanoid
a <- addresses.join(a => a.id == h.whereHeLives_id)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
96. for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
97. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
▶
98. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
}
CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
▶
99. CREATE FUNCTION AddressToSomeone (
@humanoid
Table(
called VARCHAR;
alsoCalled VARCHAR;
whereHeLives_id
)
)
SELECT
'Hello ' ||
h.called || ' ' ||
h.alsoCalled || ' of ' ||
a.city
FROM
@humanoid h
JOIN
Addresses a
ON
h.whereHeLives_id == a.id
WHERE
a.current == true
▶
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
100. case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
SELECT
'Hello ' ||
h.firstName || ' ' ||
h.lastName || ' of ' ||
a.city
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
quote { addressToSomeone(americans.map(am =>
Humanoid(am.firstName, am.lastName, am.address_id))) }
101. SELECT
'Hello ' ||
h.firstName || ' ' ||
h.lastName || ' of ' ||
a.city
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
quote {addressToSomeone(canadians.map(am =>
Humanoid(am.name, am.surname, am.residence_id)))}
SELECT
'Hello ' ||
h.name || ' ' ||
h.surname || ' of ' ||
a.city
FROM
Canadians h
JOIN
Addresses a
ON
h.residence_id == a.id
WHERE
a.current == true
102. SELECT
'Hello ' ||
h.firstName || ' ' ||
h.lastName || ' of ' ||
a.city
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
quote {addressToSomeone(yeti(am =>
Humanoid(am.gruntingSound, am.roaringSound, am.cave_id)))}
SELECT
'Hello ' ||
h.name || ' ' ||
h.surname || ' of ' ||
a.city
FROM
Canadians h
JOIN
Addresses a
ON
h.residence_id == a.id
WHERE
a.current == true
SELECT
'Hello ' ||
h.gruntingSound || ' ' ||
h.roaringSound || ' of ' ||
a.city
FROM
Yeti h
JOIN
Addresses a
ON
h.cave_id == a.id
WHERE
a.current == true
103. SELECT
'Hello ' ||
h.firstName || ' ' ||
h.lastName || ' of ' ||
a.city
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
case class Humanoid(
called:String,
alsoCalled: String,
whereHeLives_id:Int
)
val addressToSomeone = quote {
(humanoid: Query[Humanoid]) =>
for {
h <- humanoid
a <- addresses.join(a =>
a.id == h.whereHeLives_id
)
if (a.current == true)
} yield (
"Hello " +
h.called + " " +
h.alsoCalled + " of " +
a.city
)
}
SELECT
'Hello ' ||
h.name || ' ' ||
h.surname || ' of ' ||
a.city
FROM
Canadians h
JOIN
Addresses a
ON
h.residence_id == a.id
WHERE
a.current == true
SELECT
'Hello ' ||
h.gruntingSound || ' ' ||
h.roaringSound || ' of ' ||
a.city
FROM
Yeti h
JOIN
Addresses a
ON
h.cave_id == a.id
WHERE
a.current == true
▶
quote {addressToSomeone(yeti(am =>
Humanoid(am.gruntingSound, am.roaringSound, am.cave_id)))}
104. SELECT
'Hello ' ||
h.firstName || ' ' ||
h.lastName || ' of ' ||
a.city
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
SELECT
'Hello ' ||
h.name || ' ' ||
h.surname || ' of ' ||
a.city
FROM
Canadians h
JOIN
Addresses a
ON
h.residence_id == a.id
WHERE
a.current == true
SELECT
'Hello ' ||
h.gruntingSound || ' ' ||
h.roaringSound || ' of ' ||
a.city
FROM
Yeti h
JOIN
Addresses a
ON
h.cave_id == a.id
WHERE
a.current == true
DataFrame
quote {addressToSomeone(yeti(am =>
Humanoid(am.gruntingSound,
am.roaringSound, am.cave_id)))}
quote {addressToSomeone(canadians.map(am =>
Humanoid(am.name, am.surname,
am.residence_id)))}
quote { addressToSomeone(americans.map(am =>
Humanoid(am.firstName, am.lastName,
am.address_id))) }
run(Query[String]) run(Query[String]) run(Query[String])
105. DataFrame
Dataset[String]
SELECT
'Hello ' ||
h.firstName || ' ' ||
h.lastName || ' of ' ||
a.city
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
SELECT
'Hello ' ||
h.name || ' ' ||
h.surname || ' of ' ||
a.city
FROM
Canadians h
JOIN
Addresses a
ON
h.residence_id == a.id
WHERE
a.current == true
SELECT
'Hello ' ||
h.gruntingSound || ' ' ||
h.roaringSound || ' of ' ||
a.city
FROM
Yeti h
JOIN
Addresses a
ON
h.cave_id == a.id
WHERE
a.current == true
run(Query[String]) run(Query[String]) run(Query[String])
106. DataFrame
Dataset[Humanoid]
SELECT
h
FROM
Americans h
JOIN
Addresses a
ON
h.address_id == a.id
WHERE
a.current == true
SELECT
h
FROM
Canadians h
JOIN
Addresses a
ON
h.residence_id == a.id
WHERE
a.current == true
SELECT
h
FROM
Yeti h
JOIN
Addresses a
ON
h.cave_id == a.id
WHERE
a.current == true
run(Query[Humanoid]) run(Query[Humanoid]) run(Query[Humanoid])
111. val spark = SparkSession.builder()
.appName("SparkQuillExample")
.enableHiveSupport()
.getOrCreate()
implicit val sqlContext = spark.sqlContext
import sqlContext.implicits._
import QuillSparkContext._
val yetiDS = spark.read.parquet("output/yeti").as[Yeti]
val addressesDS = spark.read.parquet("output/addresses").as[Address]
Dataset[Yeti]
Dataset[Address]
112. val yetiDS = spark.read.parquet("output/yeti").as[Yeti]
val addressesDS = spark.read.parquet("output/addresses").as[Address]
val yeti = quote { liftQuery(yetiDS) }
val addresses = quote { liftQuery(addressesDS) }
Quoted[Query[Yeti]]
Quoted[Query[Address]]
Dataset[Yeti]
Dataset[Address]
113. val yetiDS = spark.read.parquet("output/yeti").as[Yeti]
val addressesDS = spark.read.parquet("output/addresses").as[Address]
val addressToSomeone = quote {
(humanoids: Query[Humanoid]) =>
for {
h <- humanoids
a <- addresses.join(a => a.id == h.whereHeLives_id)
if (a.current)
} yield "Hello " + h.called + " " + h.alsoCalled + " of " + a.city
}
val output = quote {
addressToSomeone(
yeti.map(am =>
Humanoid(am.firstName, am.lastName, am.address_id)
)
)
}
val yeti = quote { liftQuery(yetiDS) }
val addresses = quote { liftQuery(addressesDS) }
114. val yetiDS = spark.read.parquet("output/yeti").as[Yeti]
val addressesDS = spark.read.parquet("output/addresses").as[Address]
val addressToSomeone = quote {
(humanoids: Query[Humanoid]) =>
for {
h <- humanoids
a <- addresses.join(a => a.id == h.whereHeLives_id)
if (a.current)
} yield "Hello " + h.called + " " + h.alsoCalled + " of " + a.city
}
val yeti = quote { liftQuery(yetiDS) }
val addresses = quote { liftQuery(addressesDS) }
val yetiOfSomeplace: Dataset[String] = run(output)
val output = quote {
addressToSomeone(
yeti.map(am =>
Humanoid(am.firstName, am.lastName, am.address_id)
)
)
}
115. val yetiDS = spark.read.parquet("output/yeti").as[Yeti]
val addressesDS = spark.read.parquet("output/addresses").as[Address]
val addressToSomeone = quote {
(humanoids: Query[Humanoid]) =>
for {
h <- humanoids
a <- addresses.join(a => a.id == h.whereHeLives_id)
if (a.current)
} yield "Hello " + h.called + " " + h.alsoCalled + " of " + a.city
}
val yeti = quote { liftQuery(yetiDS) }
val addresses = quote { liftQuery(addressesDS) }
val yetiOfSomeplace: Dataset[String] = run(output)
val output = quote {
addressToSomeone(
yeti.map(am =>
Humanoid(am.firstName, am.lastName, am.address_id)
)
)
}
Run This Query:
Then Give Me Back
My Dataset!!!
SELECT
'Hello ' ||
h.gruntingSound || ' ' ||
h.roaringSound || ' of ' ||
a.city
FROM
Yeti h
JOIN
Addresses a
ON
h.cave_id == a.id
WHERE
a.current == true
119. ▶
val yetiOfSomeplace: Dataset[String] = run(output)
val addressToSomeone = quote { Quill Magic! }
val output = quote { Quill Magic! }
val yetiDS: Dataset[Yeti] = parquet("output/yeti").as[Yeti]
val addressesDS: Dataset[Address] = parquet("output/addresses").as[Address]
120. // Applicative Joins
yeti.join(addresses).on(_.caveId == _.id)
yeti.leftJoin(addresses).on(_.caveId == _.id)
// Implicit Joins
for {
y <- yeti
a <- addresses if (y.caveId == a.id)
} yield (y, a)
// Semi-Joins
val cavelessYeti = quote {
yeti.filter(y => !addresses.map(_.id).contains(y.caveId))
}
Some other stuff we can do...
121. Some other stuff we can do...
// Group-By
orders.groupBy(_.sku).map {
case (sku, orders) => (sku, orders.map(_.price).avg)
}
// Concat-Map
val nodesChildren = quote {
(ns: Query[Node]) => ns.concatMap(n => n.children)
}
// Union/UnionAll
val americansAndCanadians = quote {
americans.map(_.firstName) unionAll canadians.map(_.surname)
}
122. Some other stuff we can do...
// User Defined Aggregation Functions (UDAFs)
spark.udf.register("geomMean", new GeometricMean)
val geomMean = quote {
(q: Query[BigDecimal]) => infix"geomMean(${q})".as[BigDecimal]
}
orders.groupBy(_.sku).map {
case (sku, orders) => (sku, geomMean(orders.map(_.price)))
}
// Using Spark UDFs
spark.udf.register("businessLogicUdf", (str:String) => str + "-suffix")
val businessLogicUdf = quote {
(str: String) => infix"businessLogicUdf(${str})".as[String]
}
quote {
yeti.map(y => businessLogicUdf(y.gruntingSound))
}