Spark 2.0 estará entre nosotros en los próximos meses, nuestro amado Framework de procesamiento en paralelo va a sufrir un gran cambio y debemos estar preparados para afrontarlo.
Durante meses la comunidad y Databricks han estado trabajando en Spark para atender a todas las peticiones de usuarios, se han esforzado en desarrollar potentes utilidades y en continuar haciendo de Spark la herramienta numero uno de Big Data.
Primeros pasos con Apache Spark - Madrid Meetupdhiguero
Primeros pasos con Spark dentro del Apache Spark Meetup group de Madrid (http://www.meetup.com/Madrid-Apache-Spark-meetup/events/198362002/)
Contenido:
- Introdución
- Conceptos básicos
- Ecosistema Spark
- Instalación del entorno
- Errores comunes
Realizar análisis de datos cuando se tienen que cruzar grandes cantidades de información, procesarla y limpiarla es un reto difícil y dispendioso. Apache Spark es un framework para procesar grandes cantidades de información.
Presentación dada en el primer Webcast en español del Oracle RACSIG - http://oracleracsig.org/
Esta es una versión actualizada con funcionalidades de las últimas versiones (11g/12c) a la presentación que dí durante el OTN Tour 2011 en Montevideo, Oracle RAC sin sorpresas, donde se repasa lo que implica usar Oracle RAC, los desafíos y recomendaciones de cómo sacarle mejor provecho.
Este enfoque introductorio intenta facilitar el camino a los técnicos que están evaluando o comenzado a utilizar Oracle RAC, tarea que tiene una larga curva de aprendizaje.
Primeros pasos con Apache Spark - Madrid Meetupdhiguero
Primeros pasos con Spark dentro del Apache Spark Meetup group de Madrid (http://www.meetup.com/Madrid-Apache-Spark-meetup/events/198362002/)
Contenido:
- Introdución
- Conceptos básicos
- Ecosistema Spark
- Instalación del entorno
- Errores comunes
Realizar análisis de datos cuando se tienen que cruzar grandes cantidades de información, procesarla y limpiarla es un reto difícil y dispendioso. Apache Spark es un framework para procesar grandes cantidades de información.
Presentación dada en el primer Webcast en español del Oracle RACSIG - http://oracleracsig.org/
Esta es una versión actualizada con funcionalidades de las últimas versiones (11g/12c) a la presentación que dí durante el OTN Tour 2011 en Montevideo, Oracle RAC sin sorpresas, donde se repasa lo que implica usar Oracle RAC, los desafíos y recomendaciones de cómo sacarle mejor provecho.
Este enfoque introductorio intenta facilitar el camino a los técnicos que están evaluando o comenzado a utilizar Oracle RAC, tarea que tiene una larga curva de aprendizaje.
This is first part of Spark 2 new features overview
This topic covers API changes; Structured Streaming; Encoders; Memory Management in Spark; Tungsten issues; Catalyst features)
Use of spark for proteomic scoring seattle presentationlordjoe
Slides presented to the Seattle Spark Meetup on August 12 2015 - Note the work on Accumulators is a separate GitHub project https://github.com/lordjoe/SparkAccumulators
London Spark Meetup Project Tungsten Oct 12 2015Chris Fregly
Building on a previous talk about how Spark beat Hadoop @ 100TB Daytona GraySort, we present low-level details of Project Tungsten which includes many CPU and Memory optimizations.
Project Tungsten Phase II: Joining a Billion Rows per Second on a LaptopDatabricks
Tech-talk at Bay Area Apache Spark Meetup.
Apache Spark 2.0 will ship with the second generation Tungsten engine. Building upon ideas from modern compilers and MPP databases, and applying them to data processing queries, we have started an ongoing effort to dramatically improve Spark’s performance and bringing execution closer to bare metal. In this talk, we’ll take a deep dive into Apache Spark 2.0’s execution engine and discuss a number of architectural changes around whole-stage code generation/vectorization that have been instrumental in improving CPU efficiency and gaining performance.
Paris Spark Meetup Oct 26, 2015 - Spark After Dark v1.5 - Best of Advanced Ap...Chris Fregly
* Title *
Spark After Dark 1.5: Deep Dive Into Latest Perf and Scale Improvements in Spark Ecosystem
* Abstract *
Combining the most popular and technically-deep material from his wildly popular Advanced Apache Spark Meetup, Chris Fregly will provide code-level deep dives into the latest performance and scalability advancements within the Apache Spark Ecosystem by exploring the following:
1) Building a Scalable and Performant Spark SQL/DataFrames Data Source Connector such as Spark-CSV, Spark-Cassandra, Spark-ElasticSearch, and Spark-Redshift
2) Speeding Up Spark SQL Queries using Partition Pruning and Predicate Pushdowns with CSV, JSON, Parquet, Avro, and ORC
3) Tuning Spark Streaming Performance and Fault Tolerance with KafkaRDD and KinesisRDD
4) Maintaining Stability during High Scale Streaming Ingestion using Approximations and Probabilistic Data Structures from Spark, Redis, and Twitter's Algebird
5) Building Effective Machine Learning Models using Feature Engineering, Dimension Reduction, and Natural Language Processing with MLlib/GraphX, ML Pipelines, DIMSUM, Locality Sensitive Hashing, and Stanford's CoreNLP
6) Tuning Core Spark Performance by Acknowledging Mechanical Sympathy for the Physical Limitations of OS and Hardware Resources such as CPU, Memory, Network, and Disk with Project Tungsten, Asynchronous Netty, and Linux epoll
* Demos *
This talk features many interesting and audience-interactive demos - as well as code-level deep dives into many of the projects listed above.
All demo code is available on Github at the following link: https://github.com/fluxcapacitor/pipeline/wiki
In addition, the entire demo environment has been Dockerized and made available for download on Docker Hub at the following link: https://hub.docker.com/r/fluxcapacitor/pipeline/
* Speaker Bio *
Chris Fregly is a Principal Data Solutions Engineer for the newly-formed IBM Spark Technology Center, an Apache Spark Contributor, a Netflix Open Source Committer, as well as the Organizer of the global Advanced Apache Spark Meetup and Author of the Upcoming Book, Advanced Spark.
Previously, Chris was a Data Solutions Engineer at Databricks and a Streaming Data Engineer at Netflix.
When Chris isn’t contributing to Spark and other open source projects, he’s creating book chapters, slides, and demos to share knowledge with his peers at meetups and conferences throughout the world.
Video of the presentation can be seen here: https://www.youtube.com/watch?v=uxuLRiNoDio
The Data Source API in Spark is a convenient feature that enables developers to write libraries to connect to data stored in various sources with Spark. Equipped with the Data Source API, users can load/save data from/to different data formats and systems with minimal setup and configuration. In this talk, we introduce the Data Source API and the unified load/save functions built on top of it. Then, we show examples to demonstrate how to build a data source library.
Deep Dive Into Catalyst: Apache Spark 2.0’s OptimizerDatabricks
Catalyst is becoming one of the most important components in Apache Spark, as it underpins all the major new APIs in Spark 2.0, from DataFrames, Datasets, to streaming. At its core, Catalyst is a general library for manipulating trees. Based on this library, we have built a modular compiler frontend for Spark, including a query analyzer, optimizer, and an execution planner. In this talk, I will first introduce the concepts of Catalyst trees, followed by major features that were added in order to support Spark’s powerful API abstractions. Audience will walk away with a deeper understanding of how Spark 2.0 works under the hood.
Spark 2.0 is a major release of Apache Spark. This release has brought many changes to API(s) and libraries of Spark. So in this KnolX, we will be looking at some improvements that are made in Spark 2.0. Also, in these slides we will be getting an introduction to some new features in Spark 2,0 like SparkSession API and Structured Streaming.
NOTE: This was converted to Powerpoint from Keynote. Slideshare does not play the embedded videos. You can download the powerpoint from slideshare and import it into keynote. The videos should work in the keynote.
Abstract:
In this presentation, we will describe the "Spark Kernel" which enables applications, such as end-user facing and interactive applications, to interface with Spark clusters. It provides a gateway to define and run Spark tasks and to collect results from a cluster without the friction associated with shipping jars and reading results from peripheral systems. Using the Spark Kernel as a proxy, applications can be hosted remotely from Spark.
Robust and Scalable ETL over Cloud Storage with Apache SparkDatabricks
The majority of reported Spark deployments are now in the cloud. In such an environment, it is preferable for Spark to access data directly from services such as Amazon S3, thereby decoupling storage and compute. However, there are limitations to object stores such as S3. Chained or concurrent ETL jobs often run into issues on S3 due to inconsistent file listings and the lack of atomic rename support. Metadata performance also becomes an issue when running jobs over many thousands to millions of files.
Speaker: Eric Liang
This talk was originally presented at Spark Summit East 2017.
Extendiendo Django: Cómo Escribir Tu Propio Backend de Base de Datos - ExasolJavier Abadía
Django permite acceder – mediante su ORM – a distintas bases de datos. De serie, Django soporta PostgreSQL, MySQL, SQLite, Oracle y existen “backends” (es decir drivers) no oficiales para IBM DB2, Microsoft SQL Server , Firebird y bases de datos ODBC.
Pero... ¿qué pasa si nuestros datos están en una base de datos para la que no existe – todavía – un backend? ¿cómo de fácil o difícil es escribir nuestro propio backend para esa base de datos?
En esta charla compartiremos nuestra experiencia escribiendo un backend para una base de datos analítica (EXASol DB): ¿cómo lo hemos hecho? ¿qué documentación o referencias hay disponibles? ¿cómo nos aseguramos de que el acceso a los datos es correcto?
This is first part of Spark 2 new features overview
This topic covers API changes; Structured Streaming; Encoders; Memory Management in Spark; Tungsten issues; Catalyst features)
Use of spark for proteomic scoring seattle presentationlordjoe
Slides presented to the Seattle Spark Meetup on August 12 2015 - Note the work on Accumulators is a separate GitHub project https://github.com/lordjoe/SparkAccumulators
London Spark Meetup Project Tungsten Oct 12 2015Chris Fregly
Building on a previous talk about how Spark beat Hadoop @ 100TB Daytona GraySort, we present low-level details of Project Tungsten which includes many CPU and Memory optimizations.
Project Tungsten Phase II: Joining a Billion Rows per Second on a LaptopDatabricks
Tech-talk at Bay Area Apache Spark Meetup.
Apache Spark 2.0 will ship with the second generation Tungsten engine. Building upon ideas from modern compilers and MPP databases, and applying them to data processing queries, we have started an ongoing effort to dramatically improve Spark’s performance and bringing execution closer to bare metal. In this talk, we’ll take a deep dive into Apache Spark 2.0’s execution engine and discuss a number of architectural changes around whole-stage code generation/vectorization that have been instrumental in improving CPU efficiency and gaining performance.
Paris Spark Meetup Oct 26, 2015 - Spark After Dark v1.5 - Best of Advanced Ap...Chris Fregly
* Title *
Spark After Dark 1.5: Deep Dive Into Latest Perf and Scale Improvements in Spark Ecosystem
* Abstract *
Combining the most popular and technically-deep material from his wildly popular Advanced Apache Spark Meetup, Chris Fregly will provide code-level deep dives into the latest performance and scalability advancements within the Apache Spark Ecosystem by exploring the following:
1) Building a Scalable and Performant Spark SQL/DataFrames Data Source Connector such as Spark-CSV, Spark-Cassandra, Spark-ElasticSearch, and Spark-Redshift
2) Speeding Up Spark SQL Queries using Partition Pruning and Predicate Pushdowns with CSV, JSON, Parquet, Avro, and ORC
3) Tuning Spark Streaming Performance and Fault Tolerance with KafkaRDD and KinesisRDD
4) Maintaining Stability during High Scale Streaming Ingestion using Approximations and Probabilistic Data Structures from Spark, Redis, and Twitter's Algebird
5) Building Effective Machine Learning Models using Feature Engineering, Dimension Reduction, and Natural Language Processing with MLlib/GraphX, ML Pipelines, DIMSUM, Locality Sensitive Hashing, and Stanford's CoreNLP
6) Tuning Core Spark Performance by Acknowledging Mechanical Sympathy for the Physical Limitations of OS and Hardware Resources such as CPU, Memory, Network, and Disk with Project Tungsten, Asynchronous Netty, and Linux epoll
* Demos *
This talk features many interesting and audience-interactive demos - as well as code-level deep dives into many of the projects listed above.
All demo code is available on Github at the following link: https://github.com/fluxcapacitor/pipeline/wiki
In addition, the entire demo environment has been Dockerized and made available for download on Docker Hub at the following link: https://hub.docker.com/r/fluxcapacitor/pipeline/
* Speaker Bio *
Chris Fregly is a Principal Data Solutions Engineer for the newly-formed IBM Spark Technology Center, an Apache Spark Contributor, a Netflix Open Source Committer, as well as the Organizer of the global Advanced Apache Spark Meetup and Author of the Upcoming Book, Advanced Spark.
Previously, Chris was a Data Solutions Engineer at Databricks and a Streaming Data Engineer at Netflix.
When Chris isn’t contributing to Spark and other open source projects, he’s creating book chapters, slides, and demos to share knowledge with his peers at meetups and conferences throughout the world.
Video of the presentation can be seen here: https://www.youtube.com/watch?v=uxuLRiNoDio
The Data Source API in Spark is a convenient feature that enables developers to write libraries to connect to data stored in various sources with Spark. Equipped with the Data Source API, users can load/save data from/to different data formats and systems with minimal setup and configuration. In this talk, we introduce the Data Source API and the unified load/save functions built on top of it. Then, we show examples to demonstrate how to build a data source library.
Deep Dive Into Catalyst: Apache Spark 2.0’s OptimizerDatabricks
Catalyst is becoming one of the most important components in Apache Spark, as it underpins all the major new APIs in Spark 2.0, from DataFrames, Datasets, to streaming. At its core, Catalyst is a general library for manipulating trees. Based on this library, we have built a modular compiler frontend for Spark, including a query analyzer, optimizer, and an execution planner. In this talk, I will first introduce the concepts of Catalyst trees, followed by major features that were added in order to support Spark’s powerful API abstractions. Audience will walk away with a deeper understanding of how Spark 2.0 works under the hood.
Spark 2.0 is a major release of Apache Spark. This release has brought many changes to API(s) and libraries of Spark. So in this KnolX, we will be looking at some improvements that are made in Spark 2.0. Also, in these slides we will be getting an introduction to some new features in Spark 2,0 like SparkSession API and Structured Streaming.
NOTE: This was converted to Powerpoint from Keynote. Slideshare does not play the embedded videos. You can download the powerpoint from slideshare and import it into keynote. The videos should work in the keynote.
Abstract:
In this presentation, we will describe the "Spark Kernel" which enables applications, such as end-user facing and interactive applications, to interface with Spark clusters. It provides a gateway to define and run Spark tasks and to collect results from a cluster without the friction associated with shipping jars and reading results from peripheral systems. Using the Spark Kernel as a proxy, applications can be hosted remotely from Spark.
Robust and Scalable ETL over Cloud Storage with Apache SparkDatabricks
The majority of reported Spark deployments are now in the cloud. In such an environment, it is preferable for Spark to access data directly from services such as Amazon S3, thereby decoupling storage and compute. However, there are limitations to object stores such as S3. Chained or concurrent ETL jobs often run into issues on S3 due to inconsistent file listings and the lack of atomic rename support. Metadata performance also becomes an issue when running jobs over many thousands to millions of files.
Speaker: Eric Liang
This talk was originally presented at Spark Summit East 2017.
Extendiendo Django: Cómo Escribir Tu Propio Backend de Base de Datos - ExasolJavier Abadía
Django permite acceder – mediante su ORM – a distintas bases de datos. De serie, Django soporta PostgreSQL, MySQL, SQLite, Oracle y existen “backends” (es decir drivers) no oficiales para IBM DB2, Microsoft SQL Server , Firebird y bases de datos ODBC.
Pero... ¿qué pasa si nuestros datos están en una base de datos para la que no existe – todavía – un backend? ¿cómo de fácil o difícil es escribir nuestro propio backend para esa base de datos?
En esta charla compartiremos nuestra experiencia escribiendo un backend para una base de datos analítica (EXASol DB): ¿cómo lo hemos hecho? ¿qué documentación o referencias hay disponibles? ¿cómo nos aseguramos de que el acceso a los datos es correcto?
¿Necesitas una infraestructura estable con muchos años de soporte por delante?
¿Tienes unos requisitos de disponibilidad elevados?
¿Te gustaría consolidar en la misma infraestructura tus aplicaciones nuevas y legacy?
El hardware SPARC, junto con el sistema operativo Solaris, ha sido el tándem escogido por defecto por múltiples compañías para el despliegue de sus sistemas críticos y sigue teniendo un rendimiento superior al de equipos con otras arquitecturas. Los responsables de sistemas aprecian estos equipos, además de por su rendimiento, porque su operación es sencilla, apenas tienen problemas y estarán mucho tiempo operativos.
Los procesadores SPARC están diseñados conjuntamente con los equipos de desarrollo de Solaris y el resto de productos de Oracle (Base de datos, Weblogic, …), lo que permite mejorar el rendimiento del software y ofrecer un soporte unificado, desde la aplicación al hardware.
En este webinar Pedro Yagüe, Director Consulting Expert, nos mostrará por qué tantas compañías apuestan por SPARC/Solaris, una infraestructura que incluye características únicas de seguridad que permiten proteger tanto los sistemas en sí como los desarrollos realizados en ellos, así como una capa de virtualización sin coste adicional que permite maximizar el uso de los equipos y facilita la puesta en marcha de nuevos servicios.
-------------
avanttic forma ahora parte de CGI, multinacional canadiense fundada en 1976. Con presencia en 400 ubicaciones en todo el mundo y cerca de 80.000 consultores y profesionales, CGI se encuentra entre las mayores firmas independientes de servicios TI y consultoría de negocio del mundo.
En SQL Server 2008 apareció una característica no muy aprovechada por los equipos de administración de SQL Server de las empresas. Se trata de una API de fácil programación para captura de información de múltiples servidores de SQL Server para su posterior explotación. En esta sesión os daremos detalles de cómo hemos construido en SolidQ nuestra herramienta SolidQDataCollector, para que veáis qué cosas podéis llegar a conseguir con esta tecnología de desarrollo rápido
Introducción (en Español) al framework de procesamiento distribuido en memoria Apache Spark. Elementos básicos de Spark, RDD, incluye demo de las librerías SparkSQL y Spark Streaming
Presentado en www.nardoz.com
La plataforma de datos tradicional ha muerto, ha nacido una nueva plataforma de datos ubicua. Virtualizacion de datos, plataformas hibridas donde el dato no existe en una única fuente y escala sin limites. Estamos en la epoca donde realmente existe una plataforma de datos moderna. En esta sesión hablaremos del estado actual de la plataforma de datos en Microsoft
Introducción (en Español) al framework de procesamiento distribuido en memoria Apache Spark. Elementos básicos de Spark, RDD, incluye demo de las librerías SparkSQL y Spark Streaming
Presentado en www.nardoz.com
http://arjon.es/2014/08/14/introduccion-a-apache-spark-en-espanol/
Introducción a Microsoft Azure SQL Data WarehouseJoseph Lopez
El nuevo Microsoft Azure SQL Data Warehouse (SQL DW) es un versátil servicio de almacén de datos que provee una solución Massively Parallel Processing (MPP) para "Big data" con verdaderas características de alta infraestructura empresarial. El servicio SQL DW está construido para la carga de datos en ejecución de unos cien gigabytes hasta petabytes de datos con características únicas como cálculo desagregado, permitiendo así que los clientes sean capaces de utilizar el servicio para satisfacer sus necesidades de almacenamiento. En la presente exposición les mostrare una mirada en profundidad de este nuevo servicio de Azure como la implementación, el escalamiento elástico (Grow, Shrink, y Pause), y las nubes de datos híbrida con integración de Hadoop a través Polybase permitiendo una verdadera experiencia de SQL a través de datos estructurados y no estructurados.
Cómo hacer analítica de los logs que producen las aplicaciones. Introducción teorica y práctica de las tres herramientas ELK(ElasticSearch, Logstash y Kibana).
En el entorno competitivo en el que viven las empresas hoy en día es una ventaja convertir cantidades cada vez mayores de datos en información útil para el negocio y hacerlo de forma rápida, segura y con menos costes.
¿Está tu infraestructura actual preparada para asumir estos nuevos retos? ¿Tus sistemas actuales no te aportan el rendimiento necesario? ¿Te resultaría demasiado costoso realizar una ampliación en hardware y software?
Exadata es un sistema diseñado de forma conjunta entre los equipos de sistemas y de bases de datos de Oracle que tiene una arquitectura única con múltiples optimizaciones, está desplegada en muchas grandes empresas que utilizan tecnología Oracle y es la infraestructura óptima para conseguir el mejor aprovechamiento de sus datos.
En este webinar repasamos las últimas novedades introducidas en los sistemas Exadata y la experiencia real de avanttic en proyectos de migración y consolidación en esta plataforma.
Los puentes son estructuras esenciales en la infraestructura de transporte, permitiendo la conexión entre diferentes
puntos geográficos y facilitando el flujo de bienes y personas.
Metodología - Proyecto de ingeniería "Dispensador automático"cristiaansabi19
Esta presentación contiene la metodología del proyecto de la materia "Introducción a la ingeniería". Dicho proyecto es sobre un dispensador de medicamentos automáticos.
La energía radiante es una forma de energía que
se transmite en forma de ondas
electromagnéticas esta energía se propaga a
través del vacío y de ciertos medios materiales y
es fundamental en una variedad naturales y
tecnológicos
2. Quién soy
SPARK 2.0
José Carlos García Serrano
Arquitecto Big Data en Stratio.
Granadino e ingeniero por la ETSII, master de Big Data en la
UTad, certificado en Spark y AWS
Amante de las nuevas tecnologías y de las arquitecturas
basadas en Big Data
FanBoy de cosas como:
● Scala
● Spark
● Akka
● MongoDB
● Cassandra
Pero todos tenemos un pasado:
● Delphi
● C++
● BBDD SQL
● Hadoop
3. José Carlos García Serrano
Arquitecto Big Data
jcgarcia@stratio.com
CONTACTO
DICE
INTRODUCCIÓN1 2 3OPTIMIZACIÓN
• Memoria
• Funciones
SPARK CORE
• Acumuladores
• Block Manager
SPARK SQL
• Spark Session
• DataSet API
4 5 6SPARK STREAMING
• Streaming Sql API
SPARK MLlib
• Persistencia
6. SPARK 2.0
DE VERDAD ?? ESTA GENTE SABE
....
1. INTRODUCCIÓN
Spark 2.0
• Disponible en Databricks Platform
• Disponible descarga de Snapshot
• Lanzamiento inminente
• Presentado en Spark Summit
• Más rápido, más fácil y más inteligente
• Mejoradas todas las APIs de Spark:
Streaming, Sql, Mllib, Graphx
8. SPARK 2.0
2. OPTIMIZACIÓN > MEMORIA
Problema
La mayoría de los ciclos de CPU se gastan en cosas inútiles como esperas al leer y escribir datos de
caché de CPU o de memoria
9. SPARK 2.0
2. OPTIMIZACIÓN > MEMORIA
Objetivos
• Gestionar la memoria de ejecución (shuffle, joins) y memoria de
almacenamiento (memoria usada para cachear datos que son
reusados)
• Gestionar la memoria entre tareas que corren en paralelo
• Gestionar la memoria entre operadores de una misma tarea
11. SPARK 2.0
2. OPTIMIZACIÓN > MEMORIA
2.1.1 Memory Management
• Los objetos de Java consumen más memoria de la que deberían
“abcd” 4 bytes en Nativo UTF-8 y 48 bytes en Java
• El GC de Java tiende a sobre trabajar y no tiene suficiente info.
Spark ha implementado un gestor de memoria Explícito para objetos java, C-style
13. SPARK 2.0
2. OPTIMIZACIÓN > MEMORIA
2.1.2 Cache - Aware
• Reduce el tiempo de espera de datos de memoria de CPU y aumenta el tiempo útil
• Guarda en el Array de punteros la clave (64 bit -> 128 bit)
Ptr ValueKey
Nativo
Ptr ValueKey
Cache-Aware
Ordenación con menos accesos random a memoria
aggregations-sorting-joins
14. SPARK 2.0
2. OPTIMIZACIÓN > MEMORIA
2.1.3 Whole-stage code generation
• Generación de bytecode en tiempo de ejecución
• Se empezó en Spark 1.4 con ciertas funciones sql (Catalyst)
• Genera código simple para funciones complejas y genera menos
registros en caché de CPU
• Las CPU actuales están optimizadas para bucles simples
• Incrementa el rendimiento en la serialización por lo que optimiza
la fase de shuffle
20. SPARK 2.0
2. OPTIMIZACIÓN > MEMORIA
2.1.4 Vectorization
• Operaciones complejas no pueden ser abstraídas a una función
• Hay que integrar librerías externas (csv, parquet)
Opera sobre varias rows, pasa a un formato columnar!!
recordemos > CPUs optimizadas para bucles simples!!
22. SPARK 2.0
2. OPTIMIZACIÓN > FUNCIONES
2.2 Funciones
• Integración de algoritmos aproximados en DataFrames y Datasets.
HyperLogLog - CountMinSketch - BloomFilters
• ApproxCountDistinct
Estimación del número de elementos distintos que hay en una colección
• ApproxQuantile
Devuelve una aproximación a los percentiles
Ejm. approx_count = users.agg(approxCountDistinct(users['user'], rsd = rsd))
Jugamos con el margen de error, más margen => más rápido
25. SPARK 2.0
3. SPARK CORE > ACUMULADORES
3.1 Acumuladores
• Nueva API de acumuladores con un performance mejorado
• AccumulatorContext para acceder y crear
• API para implementar nuestros acumuladores propios
• Implementado el Long - Double con cosas como sum, count, and averages
val acc = new LongAccumulator
acc.setValue(100L)
acc.metadata = AccumulatorMetadata(1L, Some("longAccumulator"), false)
AccumulatorContext.register(acc)
val accAvg = acc.avg
val accSum = acc.sum
val accCount = acc.count
val longAccumulator = AccumulatorContext.get(acc.id)
26. SPARK 2.0
3. SPARK CORE > Block Manager
3.2 External Block Manager Genérico
• Se han eliminado las clases que hacían uso de Tachyon
• Se han eliminado en ciertos casos movimiento de datos por Http
28. SPARK 2.0
4. SPARK SQL
Principales funcionalidades
• Olvidar SqlContext y pensar en SparkSession
• Unificar API DataFrames/Datasets en Scala/Java en DataSets
• Lenguaje SQL extendido para un soporte del 99% TPC-DS queries
• Ejecutar SQL directamente sobre ficheros
hadoop - text - csv - parquet
29. SPARK 2.0
4. SPARK SQL > SPARK SESSION
4.1 SparkSession
• Deprecamos SQLContext
• Varias sesiones simultáneas independientes con sus propios catálogos
• Crea un SparkContext si no ha sido creado previamente
• Asignacion de parametros en caliente
sparkSession.conf.set("spark.some.config", "abcd")
• Funciones para listar, buscar y modificar el catálogo de tablas
• Opciones de configuración como variables de sustitución en SQL
sparkSession.sql("select '${spark.some.config}'")
Veámos un poco de código en Intellij ...
30. SPARK 2.0
4. SPARK SQL > API DataSet
4.2 API Dataset
• Unificada la API de DataFrames y Dataset
• type DataFrame = DataSet[Row]
• No disponible en R ni Python
• DataSet tipados y no tipados:
Operaciones sobre tipados y no tipados (map, select, etc...)
Agregaciones
32. SPARK 2.0
5. SPARK STREAMING
Principales funcionalidades
• Sql sobre streaming estructurado:
Triggers
Agregaciones continuas
• Eliminados los módulos:
Twitter
ZeroMQ
MQTT
Akka
33. SPARK 2.0
5. SPARK STREAMING > SQL STREAMING API
5.1 SQL Streaming API
• Implementado dentro del módulo de SQL
• API batch y streaming unificada
• Static DataFrame -> Infinite DataFrame
• Independiente de DStreams API
Cambiar queries en tiempo real, aplicar a ML y sink por JDBC
39. SPARK 2.0
6. SPARK MLlib > PERSISTENCIA PIPELINES
6.1 Persistencia Pipelines
• Salvar y cargar Pipelines completos
• Salvar y cargar modelos individuales
Veamos dos ejemplos ....
40. SPARK 2.0
6. SPARK MLlib > PERSISTENCIA PIPELINES
K-Means clustering model
val kmeans = new KMeans().setK(10).setSeed(12345)
val model = kmeans.fit(training)
model.save(basePath + "/model")
val sameModel = KMeansModel.load(basePath + "/model")
from pyspark.ml.clustering import KMeansModel
pyModel = KMeansModel.load(basePath + "/model")
41. SPARK 2.0
6. SPARK MLlib > PERSISTENCIA PIPELINES
Pipeline
val scaler = new StandardScaler().setInputCol("features").setOutputCol("scaledFeatures")
kmeans.setFeaturesCol("scaledFeatures")
val pipeline = new Pipeline().setStages(Array(scaler, kmeans))
pipeline.save(basePath + "/pipeline")
val samePipeline = Pipeline.load(basePath + "/pipeline")
42. SPARK 2.0
Y para otro meetup …..
Re Architecting Spark for
Mobile Platforms??? ;)
https://databricks.com/blog/2015/04/01/spark-2-rearchitecting-spark-for-mobile.html