scala

background

The best CODE Migration TOOL for SCALA Explained

Reading Time: 2 minutes Introduction With Scalafix, you can focus on the changes that truly merit your time and attention rather than having to deal with easy, repetitive, and tedious code transformations. Scalafix is the best code migration tool for Scala and transforms unsupported features in source files into newer alternatives and writes the result back to the original source file. Scalafix may not be able to perform automatic Continue Reading

Apache Spark’s Developers Friendly Structured APIs: Dataframe and Datasets

Reading Time: 3 minutes This is the second part of the blog series on Spark‘s structured APIs Dataframe & Datasets. In the first part we covered Dataframe and I recommend you go read that blog first if you are new to spark. In this blog we’ll cover the Spark Datasets API, so let’s get started. The Datasets API Datasets are also the combination of two characteristics: typed and untyped Continue Reading

Dataframe and Datasets: Apache Spark’s Developers Friendly Structured APIs

Reading Time: 4 minutes This is a two-part blogs in which first we’ll be covering Dataframe API and in the second part Datasets. Spark 2.x introduced the concept of structuring the spark by introducing two concepts: – to express some computation by using common patterns found in data analysis, such as filtering, selecting, counting, aggregating, and grouping. And the second one of order and structure your data in a Continue Reading

Different Types of JOIN in Spark SQL

Reading Time: 3 minutes Join in Spark SQL is the functionality to join two or more datasets that are similar to the table join in SQL based databases. Spark works as the tabular form of datasets and data frames. The Spark SQL supports several types of joins such as inner join, cross join, left outer join, right outer join, full outer join, left semi-join, left anti join. Joins scenarios Continue Reading

Setting up the Play Framework

Reading Time: 2 minutes What Play is? Play is a high productivity Java and Scala web application framework that integrates the components and APIs you need to the modern web application. It is a Web framework whose HTTP interface is simple and powerful. Play Requirements: To function correctly, the Play application only needs to include the Play JAR files. Because these JAR files are published to the Maven Repository, Continue Reading

What are Zio Effect Constructors?

Reading Time: 3 minutes In this blog post, we will discuss about ZIO effect constructors and how we can use them. Then we’ll take a look at Effect constructors for pure computations and side-effecting computations. Zio Effect Constructors A functional effect is a template for a concurrent workflow. The template which is mostly descriptive in nature, used to test for any side effects. Such as database interaction, logging, data Continue Reading

Sequential Composition in Scala Zio

Reading Time: 3 minutes Overview In this blog we will discuss how the concurrent workflows can be simplified and can be executed in a sequential manner using flatmap and other sequential composition.The flatmap method of ZIO effect represents sequential composition where output of first effect act as input for the second. Further in this blog we will discuss some more operators that can define further workflow. You need to Continue Reading

Monad – Introductory approach using Scala

Reading Time: 3 minutes Overview In this blog, I will try to keep everything beginner-friendly for monad in scala but still, you need some basic understanding of Scala that will help you get along. We will use terms like pure functions, side effects, etc very frequently in this blog so make sure you have a knack for it. Monad? Monad construction performs successive computations, it is an object that Continue Reading

How to Compose Layers in Zio

Reading Time: 5 minutes Introduction According to ZIO documentation, we know ZIO is a library for asynchronous and concurrent programming that promotes pure functional programming. The core of the ZIO library provides a powerful effect type ZIO inspired by Haskell’s IO monad. The value of this type doesn’t do anything itself. It is just a description of something that should be done.ZIO runtime system is responsible for actually doing what is Continue Reading

Composing and Chaining Effects together in ZIO

Reading Time: 3 minutes Introduction to ZIO ZIO is a library for asynchronous and concurrent programming that is based on pure functional programming. It combined with Scala help us to develop applications that are purely functional, asynchronous, type-safe, resilient, and testable. At the core of ZIO is ZIO data type which is defined as: ZIO is lazy! The difference between ZIO and procedural programming is quite straightforward. In the Continue Reading

Introduction to Match Expressions and Pattern Matching in Scala

Reading Time: 4 minutes In this article, we will discuss match expressions and pattern matching in Scala. A match expression contains one or more case statements which are used to match against possible values. Match expressions in Scala are comparable to switch statements in other programming languages such as JavaScript or Java. They are an alternative to a series of if/else statements. Match expressions have some differences from switch Continue Reading

exception handling

How to Handle Errors in Scala

Reading Time: 3 minutes Error handling is the process of handling the possibility of failure. For example, failing to read a file and then continuing to use that bad input would clearly be problematic. Noticing and explicitly managing these errors saves the rest of the program from various pitfalls. When an exception occurs, say an Arithmetic Exception then the current operation is aborted. Then the runtime system looks for an exception Continue Reading

zio

ZIO: The Most Important Data Type Of ZIO Library

Reading Time: 3 minutes Overview In this blog, we’ll understand about the most important data type of ZIO library i.e. ZIO and the type aliases available for it which are very useful when it comes to representing some common use cases. What is ZIO library used for? ZIO is a zero dependency Scala library that provides many features for developing concurrent, parallel, asynchronous and resources safe applications in a Continue Reading