Spark Actions (as of 2.4.1)
There are three kinds of actions:
- view data in the console
- collect data to language-native objects
- write to output data sources
.aggregate(zeroValue)(seqOp, combOp)
class arch{ | |
public static void main(String[] args) throws Exception{ | |
String os = System.getProperty("os.name").toLowerCase().replace(" ", "_"); | |
String arch = System.getProperty("os.arch").toLowerCase().replace(" ", "_"); | |
System.out.println("OS: " + os + " arch: " + arch ); | |
}} |
DECLARE INT month_ago; DECLARE INT streams_cutover_date; | |
SET month_ago = 200; SET streams_cutover_date = 2000; | |
-- ~~~ historical ~~~ -- | |
INGEST * FROM source_database | |
WHERE | |
t < month_ago ; | |
-- ~~~ incremental ~~~ -- | |
INGEST * FROM source_database |
from pyspark import SparkContext | |
from pyspark.sql import SparkSession | |
from pyspark.sql.functions import lit | |
from random import randint, seed | |
input_file = '/tmp/input.snappy.parquet' | |
output_file = '/tmp/output.snappy.parquet' | |
spark = SparkSession(SparkContext('local', 'make-recs-application')) |
[tool.poetry] | |
name = "legion-airflow" | |
version = "0.1.0" | |
description = "Airflow Operators for Legion" | |
license = "Apache2" | |
authors = [ | |
"[email protected] <[email protected]>" | |
] |
Spark Actions (as of 2.4.1)
There are three kinds of actions:
.aggregate(zeroValue)(seqOp, combOp)
#!/bin/bash -x | |
readonly HERE=$(pwd) | |
readonly BASEDIR=~/scratch | |
readonly BOSHINSTALLNAME='bosh0' | |
# SETUP | |
readonly BOSHDIR="${BASEDIR}/${BOSHINSTALLNAME}" | |
echo "Setting up deployment in ${BOSHDIR}..." |
// ...And we will take two more readings. | |
int on_1 = analogRead(photoresistor); // read photoresistor | |
delay(200); // wait 200 milliseconds | |
int on_2 = analogRead(photoresistor); // read photoresistor | |
delay(300); // wait 300 milliseconds | |
intactValue = (on_1+on_2)/2; | |
brokenValue = (off_1+off_2)/2; | |
beamThreshold = (intactValue+brokenValue)/2; |
// constants | |
const int greenLEDPin = 9; | |
const int redLEDPin = 11; | |
const int blueLEDPin = 10; | |
const int redSensorPin = A0; | |
const int greenSensorPin = A0; | |
const int blueSensorPin = A0; |
<!-- PARSES --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:os-core="http://www.openspaces.org/schema/core" | |
xmlns:os-events="http://www.openspaces.org/schema/events" | |
xmlns:os-remoting="http://www.openspaces.org/schema/remoting" | |
xmlns:os-sla="http://www.openspaces.org/schema/sla" |
sudo docker start \ | |
--name data -t \ | |
-v /opt/manager/resources/packages \ | |
-w /tmp/work_dir \ | |
-v ~/:/tmp/home \ | |
-v /root --privileged=False \ | |
-v /etc/init.d \ | |
-v /etc/default \ | |
-v /opt/manager/resources \ | |
-v /opt/manager/env \ |