This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.SparkConf; | |
import org.apache.spark.api.java.JavaSparkContext; | |
import org.apache.spark.sql.hive.HiveContext; | |
import org.apache.spark.sql.SQLContext; | |
public class JavaSparkSQL { | |
public static void main(String[] args) throws Exception { | |
SparkConf sparkConf = new SparkConf().setAppName("Spark SQL Test"); | |
JavaSparkContext ctx = new JavaSparkContext(sparkConf); | |
HiveContext hiveContext = new HiveContext(ctx.sc()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
become: true | |
become_method: sudo | |
become_user: root | |
vars: | |
anaconda_version: 4.3.0 | |
anaconda_parent_dir: /opt/ | |
anaconda3_path: "/opt/Anaconda3-{{ anaconda_version }}-Linux-x86_64" | |
pre_tasks: | |
- name: Check if Anaconda 3 is already installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEBUG="$@" | |
run() { | |
if [[ -z "$DEBUG" ]] | |
then | |
sudo "$@" | |
else | |
echo sudo "$@" | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/parquet-avro/pom.xml b/parquet-avro/pom.xml | |
index aeba102..34efc1b 100644 | |
--- a/parquet-avro/pom.xml | |
+++ b/parquet-avro/pom.xml | |
@@ -49,7 +49,6 @@ | |
<groupId>com.google.guava</groupId> | |
<artifactId>guava</artifactId> | |
<version>11.0</version> | |
- <scope>test</scope> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileOutputStream; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.Statement; | |
import java.util.Random; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.BlockingQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} catch (NullPointerException e) { | |
throw npe(e, " of "+schema.getFullName()); | |
} | |
} | |
/** Helper method for adding a message to an NPE. */ | |
protected NullPointerException npe(NullPointerException e, String s) { | |
NullPointerException result = new NullPointerException(e.getMessage()+s); | |
result.initCause(e.getCause() == null ? e : e.getCause()); | |
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.net.InetAddress; | |
import java.util.Arrays; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hdfs.server.namenode.NameNode; | |
import org.apache.hadoop.ipc.RPC; | |
import org.apache.hadoop.ipc.Server; | |
import org.apache.hadoop.net.DNS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In this lesson we will learn about navigating the shell aka the prompt. | |
# | |
# When you see, this: | |
$ | |
# it means you have clicked the "Terminal" application on the right | |
# hand side and the application is ready for you to type. | |
# Now we are going to connect to "big computer" so that you can |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
We going to use BBEdit to edit files now, but first we must learn a few command line skills | |
so we can execute our scripts when needed. Let's open the Terminal and type pwd: | |
$ pwd | |
/Users/noland | |
The "$" simply means I am executing these commands in the Terminal. It should say /Users/brianna | |
which is known as your working directory. The pwd command stands for print working directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In addition to the while loop, there is a an "if" construct. It works like so: | |
if drunk: | |
do not drive | |
# or | |
if tired: | |
sleep | |
NewerOlder