package de.hsma.informatik.bdea;

import java.util.Arrays;
import java.util.List;

import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Encoders;
import org.apache.spark.sql.SparkSession;

public class BasicDataset {

	public static void main(String[] args) {
	    SparkSession spark = SparkSession
	    	      .builder()
	    	      .appName("DSExample").master("local[4]")
	    	      .getOrCreate();
		
		List<Integer> data = Arrays.asList(2, 3, 4, 6, 7, 8);
		Dataset<Integer> ds = spark.createDataset(data, Encoders.INT());
		
		ds.createOrReplaceTempView("numbers");
		spark.sql("select * from numbers where value > 3").show();
	}

}