├── .gitignore ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── in ├── 2016-stack-overflow-survey-responses.csv ├── RealEstate.csv ├── airports.text ├── nasa_19950701.tsv ├── nasa_19950801.tsv ├── prime_nums.text ├── uk-makerspaces-identifiable-data.csv ├── uk-postcode.csv ├── uppercase.text └── word_count.text └── src └── main └── scala └── com └── sparkTutorial ├── advanced ├── accumulator │ ├── StackOverFlowSurvey.scala │ └── StackOverFlowSurveyFollowUp.scala └── broadcast │ ├── UkMakerSpaces.scala │ └── UkMakerSpacesWithoutBroadcast.scala ├── commons └── Utils.scala ├── pairRdd ├── aggregation │ ├── combinebykey │ │ └── AverageHousePriceSolution.scala │ └── reducebykey │ │ ├── WordCount.scala │ │ └── housePrice │ │ ├── AverageHousePriceProblem.scala │ │ ├── AverageHousePriceSolution.scala │ │ └── AvgCount.scala ├── create │ ├── PairRddFromRegularRdd.scala │ └── PairRddFromTupleList.scala ├── filter │ ├── AirportsNotInUsaProblem.scala │ └── AirportsNotInUsaSolution.scala ├── groupbykey │ ├── AirportsByCountryProblem.scala │ ├── AirportsByCountrySolution.scala │ └── GroupByKeyVsReduceByKey.scala ├── join │ └── JoinOperations.scala ├── mapValues │ ├── AirportsUppercaseProblem.scala │ └── AirportsUppercaseSolution.scala └── sort │ ├── AnotherSortedWordCountSolution.scala │ ├── AverageHousePriceSolution.scala │ ├── SortedWordCountProblem.scala │ └── SortedWordCountSolution.scala ├── rdd ├── WordCount.scala ├── airports │ ├── AirportsByLatitudeProblem.scala │ ├── AirportsByLatitudeSolution.scala │ ├── AirportsInUsaProblem.scala │ └── AirportsInUsaSolution.scala ├── collect │ └── CollectExample.scala ├── count │ └── CountExample.scala ├── nasaApacheWebLogs │ ├── SameHostsProblem.scala │ ├── SameHostsSolution.scala │ ├── UnionLogProblem.scala │ └── UnionLogsSolution.scala ├── persist │ └── PersistExample.scala ├── reduce │ └── ReduceExample.scala ├── sumOfNumbers │ ├── SumOfNumbersProblem.scala │ └── SumOfNumbersSolution.scala └── take │ └── TakeExample.scala └── sparkSql ├── HousePriceProblem.scala ├── HousePriceSolution.scala ├── RddDatasetConversion.scala ├── Response.scala ├── StackOverFlowSurvey.scala ├── TypedDataset.scala └── join └── UkMakerSpaces.scala /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle/ 2 | *.iml 3 | *.ipr 4 | *.iws 5 | out/ 6 | build/ 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # scala-spark-tutorial 2 | 3 | Project source code for James Lee's Aparch Spark with Scala course. 4 | 5 | Check out the full list of DevOps and Big Data courses that James and Tao teach. 6 | 7 | https://www.level-up.one/courses/ 8 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | group 'jameslee' 2 | version '1.0-SNAPSHOT' 3 | 4 | apply plugin: 'scala' 5 | apply plugin: 'idea' 6 | apply plugin: 'eclipse' 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | 12 | idea { 13 | project { 14 | jdkName = '1.8' 15 | languageLevel = '1.8' 16 | } 17 | } 18 | 19 | dependencies { 20 | compile group: 'org.apache.spark', name: 'spark-core_2.11', version: '2.2.0' 21 | compile group: 'org.apache.spark', name: 'spark-sql_2.11', version: '2.2.0' 22 | compile group: 'org.scala-lang', name: 'scala-library', version: '2.11.11' 23 | } 24 | 25 | configurations.all { 26 | resolutionStrategy { 27 | force 'com.google.guava:guava:12.0.1' 28 | } 29 | } 30 | 31 | compileScala.targetCompatibility = "1.8" 32 | compileScala.sourceCompatibility = "1.8" 33 | 34 | 35 | jar { 36 | zip64 true 37 | archiveName = "StackOverFlowSurvey-spark.jar" 38 | from { 39 | configurations.compile.collect { 40 | it.isDirectory() ? it : zipTree(it) 41 | } 42 | } 43 | manifest { 44 | attributes 'Main-Class': 'com.sparkTutorial.sparkSql.StackOverFlowSurvey' 45 | } 46 | 47 | exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' 48 | 49 | } 50 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jleetutorial/scala-spark-tutorial/7cbb399a77521a376232839f539103670709d151/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Oct 25 21:49:41 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /in/RealEstate.csv: -------------------------------------------------------------------------------- 1 | MLS,Location,Price,Bedrooms,Bathrooms,Size,Price SQ Ft,Status 2 | 132842,Arroyo Grande,795000.00,3,3,2371,335.30,Short Sale 3 | 134364,Paso Robles,399000.00,4,3,2818,141.59,Short Sale 4 | 135141,Paso Robles,545000.00,4,3,3032,179.75,Short Sale 5 | 135712,Morro Bay,909000.00,4,4,3540,256.78,Short Sale 6 | 136282,Santa Maria-Orcutt,109900.00,3,1,1249,87.99,Short Sale 7 | 136431,Oceano,324900.00,3,3,1800,180.50,Short Sale 8 | 137036,Santa Maria-Orcutt,192900.00,4,2,1603,120.34,Short Sale 9 | 137090,Santa Maria-Orcutt,215000.00,3,2,1450,148.28,Short Sale 10 | 137159,Morro Bay,999000.00,4,3,3360,297.32,Short Sale 11 | 137570,Atascadero,319000.00,3,2,1323,241.12,Short Sale 12 | 138053,Santa Maria-Orcutt,350000.00,3,2,1750,200.00,Short Sale 13 | 138730,Santa Maria-Orcutt,249000.00,3,2,1400,177.86,Short Sale 14 | 139291,Arroyo Grande,299000.00,2,2,1257,237.87,Short Sale 15 | 139427,Santa Maria-Orcutt,235900.00,3,2,1400,168.50,Short Sale 16 | 139461,Santa Maria-Orcutt,348000.00,3,2,1600,217.50,Short Sale 17 | 139661,Paso Robles,314000.00,4,3,1794,175.03,Short Sale 18 | 139918,Los Alamos,399000.00,4,2,1850,215.68,Short Sale 19 | 139932,San Miguel,599000.00,3,3,2950,203.05,Short Sale 20 | 140044,Paso Robles,299000.00,3,2,1719,173.94,Short Sale 21 | 140073,San Luis Obispo,425000.00,3,3,1472,288.72,Short Sale 22 | 140077,Morro Bay,1100000.00,4,3,4168,263.92,Short Sale 23 | 140080,Cayucos,1500000.00,3,3,3880,386.60,Short Sale 24 | 140113,Santa Maria-Orcutt,110000.00,2,1,1000,110.00,Short Sale 25 | 140395,Santa Maria-Orcutt,200000.00,3,2,1139,175.59,Short Sale 26 | 140460,Santa Maria-Orcutt,134900.00,3,1,1080,124.91,Short Sale 27 | 140703,Santa Maria-Orcutt,250000.00,4,3,2000,125.00,Short Sale 28 | 140720,Pismo Beach,950000.00,3,4,1920,494.79,Short Sale 29 | 140731,Santa Maria-Orcutt,239950.00,4,2,1348,178.00,Short Sale 30 | 141188,Santa Maria-Orcutt,170000.00,3,2,1280,132.81,Short Sale 31 | 141212,Santa Maria-Orcutt,285000.00,3,2,2400,118.75,Short Sale 32 | 141232,Santa Maria-Orcutt,279000.00,3,3,1700,164.12,Short Sale 33 | 141529,Santa Maria-Orcutt,219000.00,3,2,1600,136.88,Short Sale 34 | 141541,Santa Maria-Orcutt,155000.00,3,2,1050,147.62,Short Sale 35 | 141737,Atascadero,389000.00,3,2,1415,274.91,Short Sale 36 | 141847,Nipomo,340000.00,3,1,1110,306.31,Short Sale 37 | 141869,Guadalupe,95000.00,2,1,797,119.20,Short Sale 38 | 142216,Santa Maria-Orcutt,140000.00,2,2,1100,127.27,Short Sale 39 | 142340,Pismo Beach,1100000.00,3,3,2602,422.75,Short Sale 40 | 142442,Santa Maria-Orcutt,360000.00,4,3,2351,153.13,Short Sale 41 | 142528,Morro Bay,415000.00,3,3,1350,307.41,Short Sale 42 | 142539,Santa Maria-Orcutt,250000.00,4,2,1206,207.30,Short Sale 43 | 142585,Santa Maria-Orcutt,559000.00,3,3,2628,212.71,Short Sale 44 | 142818,Nipomo,525000.00,3,3,2365,221.99,Short Sale 45 | 142829,Los Osos,779000.00,3,3,2990,260.54,Short Sale 46 | 142870,Arroyo Grande,595000.00,3,2,1750,340.00,Short Sale 47 | 142977,Templeton,1150000.00,4,5,5500,209.09,Short Sale 48 | 143037,Templeton,550000.00,3,2,1852,296.98,Short Sale 49 | 143155,Grover Beach,500000.00,3,2,2100,238.10,Short Sale 50 | 143170,Santa Maria-Orcutt,279000.00,4,3,2580,108.14,Short Sale 51 | 143178,Santa Maria-Orcutt,375000.00,4,2,1963,191.03,Short Sale 52 | 143217,Santa Maria-Orcutt,330000.00,3,3,1900,173.68,Short Sale 53 | 143252,Santa Maria-Orcutt,199000.00,3,3,1450,137.24,Short Sale 54 | 143255,Santa Maria-Orcutt,165000.00,2,2,1000,165.00,Short Sale 55 | 143436,Templeton,1399000.00,4,3,6500,215.23,Foreclosure 56 | 143507,Santa Maria-Orcutt,255000.00,3,2,1218,209.36,Short Sale 57 | 143524,Cambria,325000.00,2,2,893,363.94,Short Sale 58 | 143534,Morro Bay,789000.00,3,3,2100,375.71,Foreclosure 59 | 143540,Nipomo,498000.00,4,3,2341,212.73,Short Sale 60 | 143884,Nipomo,430000.00,4,2,2168,198.34,Short Sale 61 | 143946,Paso Robles,539900.00,4,3,3032,178.07,Short Sale 62 | 144204,Pismo Beach,499000.00,3,2,1293,385.92,Short Sale 63 | 144238,Los Osos,275000.00,3,2,1200,229.17,Short Sale 64 | 144312,Santa Maria-Orcutt,499000.00,3,4,2250,221.78,Short Sale 65 | 144314,Morro Bay,899000.00,3,3,2430,369.96,Foreclosure 66 | 144316,Morro Bay,1045000.00,3,3,2100,497.62,Foreclosure 67 | 144318,Morro Bay,774000.00,2,2,1550,499.35,Foreclosure 68 | 144370,Santa Maria-Orcutt,239000.00,3,3,1800,132.78,Short Sale 69 | 144380,Santa Maria-Orcutt,195000.00,3,2,1218,160.10,Short Sale 70 | 144788,Grover Beach,325000.00,2,1,768,423.18,Short Sale 71 | 144815,Nipomo,320000.00,4,2,1929,165.89,Short Sale 72 | 144896,Santa Maria-Orcutt,275000.00,4,3,1877,146.51,Short Sale 73 | 145087,Paso Robles,329000.00,3,2,1700,193.53,Short Sale 74 | 145138,Santa Maria-Orcutt,140000.00,3,2,1080,129.63,Short Sale 75 | 145309,Paso Robles,409000.00,4,3,2192,186.59,Short Sale 76 | 145448,Santa Maria-Orcutt,167900.00,3,2,1296,129.55,Foreclosure 77 | 145471,Nipomo,325000.00,7,5,2688,120.91,Short Sale 78 | 145726,Santa Maria-Orcutt,119000.00,1,1,900,132.22,Short Sale 79 | 145745,Santa Maria-Orcutt,245000.00,4,2,1482,165.32,Short Sale 80 | 145789,Santa Maria-Orcutt,259900.00,3,2,1726,150.58,Short Sale 81 | 145850,Arroyo Grande,495000.00,3,2,1486,333.11,Short Sale 82 | 145952,San Luis Obispo,399000.00,4,2,1543,258.59,Short Sale 83 | 146040,Santa Maria-Orcutt,329700.00,4,2,1367,241.19,Short Sale 84 | 146110,Atascadero,199000.00,1,1,712,279.49,Short Sale 85 | 146130,Santa Maria-Orcutt,149000.00,3,2,1040,143.27,Short Sale 86 | 146144,Paso Robles,225000.00,3,2,1456,154.53,Short Sale 87 | 146149,Santa Maria-Orcutt,195000.00,2,1,811,240.44,Short Sale 88 | 146212,Paso Robles,359900.00,3,3,1951,184.47,Short Sale 89 | 146223,Templeton,799000.00,4,4,3100,257.74,Short Sale 90 | 146282,San Luis Obispo,595000.00,3,2,2117,281.06,Short Sale 91 | 146302,Paso Robles,89000.00,3,2,1560,57.05,Short Sale 92 | 146310,Santa Maria-Orcutt,129900.00,3,1,1042,124.66,Short Sale 93 | 146320,Los Osos,375000.00,3,3,1519,246.87,Short Sale 94 | 146423,Atascadero,599000.00,3,2,2774,215.93,Short Sale 95 | 146496,Paso Robles,235000.00,3,2,1340,175.37,Short Sale 96 | 146537,Santa Maria-Orcutt,255900.00,3,2,1440,177.71,Foreclosure 97 | 146544,Santa Maria-Orcutt,148900.00,5,2,1064,139.94,Short Sale 98 | 146581,Arroyo Grande,749000.00,3,2,2145,349.18,Short Sale 99 | 146597,Santa Maria-Orcutt,189900.00,3,2,1472,129.01,Foreclosure 100 | 146649,Paso Robles,183000.00,3,1,888,206.08,Short Sale 101 | 146667,Santa Maria-Orcutt,232600.00,3,3,1582,147.03,Short Sale 102 | 146773,Cambria,520000.00,3,2,1680,309.52,Short Sale 103 | 146790,Solvang,355000.00,3,3,1702,208.58,Foreclosure 104 | 146797,Pismo Beach,275000.00,0,1,398,690.95,Short Sale 105 | 146888,Santa Maria-Orcutt,225000.00,4,3,1940,115.98,Short Sale 106 | 146986,Santa Maria-Orcutt,161900.00,3,2,1200,134.92,Short Sale 107 | 147094,Santa Maria-Orcutt,249999.00,3,3,2013,124.19,Short Sale 108 | 147167,Santa Maria-Orcutt,208000.00,2,1,1267,164.17,Short Sale 109 | 147214,Guadalupe,135000.00,3,1,1100,122.73,Short Sale 110 | 147216,San Luis Obispo,385000.00,2,3,1389,277.18,Short Sale 111 | 147240,Atascadero,750000.00,4,4,3387,221.43,Foreclosure 112 | 147241,Atascadero,810000.00,4,3,3305,245.08,Foreclosure 113 | 147249,Atascadero,890000.00,4,5,4229,210.45,Foreclosure 114 | 147253,Atascadero,895000.00,4,3,3676,243.47,Foreclosure 115 | 147374,San Miguel,229900.00,3,2,1458,157.68,Short Sale 116 | 147440,Grover Beach,240000.00,2,2,1020,235.29,Short Sale 117 | 147450,Atascadero,429000.00,4,3,2513,170.71,Foreclosure 118 | 147570,Santa Maria-Orcutt,399000.00,4,3,2800,142.50,Short Sale 119 | 147586,Santa Maria-Orcutt,385000.00,3,2,2000,192.50,Short Sale 120 | 147603,Paso Robles,294900.00,3,2,1316,224.09,Foreclosure 121 | 147611,Paso Robles,399000.00,3,2,1220,327.05,Short Sale 122 | 147620,Santa Maria-Orcutt,269000.00,3,3,1780,151.12,Short Sale 123 | 147654,Cambria,449000.00,3,3,2120,211.79,Short Sale 124 | 147761,Arroyo Grande,555900.00,5,3,2947,188.63,Foreclosure 125 | 147767,Paso Robles,319900.00,4,2,2135,149.84,Foreclosure 126 | 147819,Cambria,332000.00,4,4,1872,177.35,Foreclosure 127 | 147876,Bradley,499000.00,4,5,3400,146.76,Short Sale 128 | 147948,Paso Robles,432000.00,4,3,3113,138.77,Short Sale 129 | 148070,Arroyo Grande,199000.00,2,1,827,240.63,Short Sale 130 | 148168,Santa Maria-Orcutt,29000.00,2,2,1500,19.33,Foreclosure 131 | 148195,Atascadero,299000.00,3,2,1270,235.43,Short Sale 132 | 148289,Santa Maria-Orcutt,259000.00,4,3,1857,139.47,Short Sale 133 | 148318,Los Osos,99000.00,1,1,538,184.01,Short Sale 134 | 148324,Avila Beach,779000.00,2,2,1223,636.96,Foreclosure 135 | 148325,Avila Beach,839000.00,2,2,1223,686.02,Foreclosure 136 | 148384,Santa Ynez,525000.00,3,2,1746,300.69,Short Sale 137 | 148399,Santa Ynez,795000.00,3,2,2092,380.02,Short Sale 138 | 148472,Santa Maria-Orcutt,337000.00,4,2,2000,168.50,Short Sale 139 | 148519,Oceano,164900.00,2,1,750,219.87,Foreclosure 140 | 148622,San Luis Obispo,449000.00,2,3,1650,272.12,Short Sale 141 | 148624,Guadalupe,94000.00,2,2,797,117.94,Foreclosure 142 | 148638,Pismo Beach,899000.00,3,3,2266,396.73,Short Sale 143 | 148736,Santa Maria-Orcutt,180000.00,3,2,1280,140.63,Short Sale 144 | 148744,Bradley,194900.00,3,2,1092,178.48,Foreclosure 145 | 148757,Los Osos,350000.00,3,2,1509,231.94,Short Sale 146 | 148806,King City,167770.00,3,3,1793,93.57,Foreclosure 147 | 148842,Creston,309900.00,3,2,1705,181.76,Foreclosure 148 | 148881,Templeton,479000.00,2,3,2100,228.10,Short Sale 149 | 148961,Los Alamos,350000.00,3,2,1582,221.24,Short Sale 150 | 149001,Grover Beach,350000.00,3,2,1470,238.10,Short Sale 151 | 149024,Santa Maria-Orcutt,275000.00,3,2,1424,193.12,Short Sale 152 | 149039,Paso Robles,379000.00,4,3,2277,166.45,Short Sale 153 | 149069,King City,155900.00,4,2,3368,46.29,Foreclosure 154 | 149105,San Miguel,229000.00,3,2,1458,157.06,Short Sale 155 | 149193,Pismo Beach,604995.00,2,3,1749,345.91,Foreclosure 156 | 149207,Pismo Beach,599000.00,3,3,1996,300.10,Short Sale 157 | 149230,Morro Bay,359000.00,3,2,1008,356.15,Short Sale 158 | 149275,Lompoc,199000.00,4,2,1527,130.32,Foreclosure 159 | 149287,Paso Robles,164900.00,3,2,1440,114.51,Short Sale 160 | 149307,Coalinga,179000.00,3,2,1815,98.62,Short Sale 161 | 149317,Paso Robles,370000.00,4,2,2064,179.26,Short Sale 162 | 149324,Santa Ynez,999000.00,5,4,2402,415.90,Short Sale 163 | 149369,Paso Robles,365000.00,3,3,2136,170.88,Short Sale 164 | 149401,San Miguel,345000.00,3,2,1498,230.31,Short Sale 165 | 149412,Paso Robles,299000.00,2,1,1068,279.96,Short Sale 166 | 149439,Pismo Beach,519500.00,2,1,634,819.40,Short Sale 167 | 149470,Buellton,645000.00,4,4,3000,215.00,Short Sale 168 | 149482,Santa Maria-Orcutt,242500.00,3,2,1218,199.10,Foreclosure 169 | 149514,Santa Maria-Orcutt,259900.00,3,3,1300,199.92,Short Sale 170 | 149604,Santa Maria-Orcutt,310000.00,4,3,2014,153.92,Short Sale 171 | 149612,Atascadero,450000.00,2,2,1463,307.59,Short Sale 172 | 149615,Santa Maria-Orcutt,220000.00,2,2,1541,142.76,Short Sale 173 | 149616,San Luis Obispo,585000.00,3,2,1268,461.36,Short Sale 174 | 149633,Santa Maria-Orcutt,324000.00,5,4,2400,135.00,Short Sale 175 | 149666,Cambria,375000.00,1,1,551,680.58,Short Sale 176 | 149700,Paso Robles,329000.00,3,2,1420,231.69,Short Sale 177 | 149752,Paso Robles,599900.00,5,3,2764,217.04,Foreclosure 178 | 149791,Santa Maria-Orcutt,74900.00,2,2,1014,73.87,Short Sale 179 | 149797,Los Osos,285000.00,3,2,1120,254.46,Short Sale 180 | 149813,Santa Maria-Orcutt,751900.00,3,3,3400,221.15,Foreclosure 181 | 149829,Santa Maria-Orcutt,295000.00,3,2,1386,212.84,Short Sale 182 | 149839,Coalinga,170000.00,3,2,1320,128.79,Short Sale 183 | 149841,Santa Maria-Orcutt,197000.00,3,2,1376,143.17,Short Sale 184 | 149860,Oceano,1250000.00,3,3,2586,483.37,Short Sale 185 | 149864,Paso Robles,249000.00,3,2,1662,149.82,Short Sale 186 | 149869,Nipomo,179000.00,2,2,1033,173.28,Short Sale 187 | 149877,Santa Maria-Orcutt,132000.00,3,1,1050,125.71,Short Sale 188 | 149882,Lockwood,425000.00,3,2,1500,283.33,Short Sale 189 | 149890,Santa Maria-Orcutt,290000.00,5,3,2500,116.00,Short Sale 190 | 149909,Los Osos,150000.00,2,2,896,167.41,Short Sale 191 | 149911,Los Osos,150000.00,2,2,896,167.41,Short Sale 192 | 149914,Los Osos,150000.00,2,2,896,167.41,Short Sale 193 | 149915,Los Osos,150000.00,2,2,896,167.41,Short Sale 194 | 149916,Los Osos,150000.00,2,2,896,167.41,Short Sale 195 | 149917,Los Osos,205000.00,2,2,1388,147.69,Short Sale 196 | 149919,Atascadero,599000.00,4,3,3120,191.99,Short Sale 197 | 149922,Paso Robles,269000.00,3,3,1352,198.96,Short Sale 198 | 149948,Santa Maria-Orcutt,249000.00,4,3,1963,126.85,Short Sale 199 | 149956,Santa Maria-Orcutt,235000.00,3,3,1541,152.50,Short Sale 200 | 149961,Grover Beach,469000.00,4,3,2449,191.51,Foreclosure 201 | 149989,Nipomo,159000.00,4,2,1660,95.78,Short Sale 202 | 149994,King City,69900.00,3,1,936,74.68,Foreclosure 203 | 150143,Arroyo Grande,1499000.00,5,7,6800,220.44,Short Sale 204 | 150194,Atascadero,239000.00,3,2,1022,233.86,Short Sale 205 | 150199,Atascadero,399500.00,3,2,1665,239.94,Short Sale 206 | 150240,Paso Robles,299900.00,3,2,1209,248.06,Foreclosure 207 | 150256,Lompoc,275000.00,3,2,1700,161.76,Short Sale 208 | 150262,Morro Bay,395000.00,4,2,1736,227.53,Short Sale 209 | 150283,Santa Maria-Orcutt,105000.00,1,1,731,143.64,Short Sale 210 | 150290,Santa Maria-Orcutt,179999.00,3,2,1086,165.74,Short Sale 211 | 150294,Santa Maria-Orcutt,219000.00,3,2,1131,193.63,Short Sale 212 | 150308,Solvang,325000.00,3,3,1500,216.67,Short Sale 213 | 150317,Atascadero,829900.00,4,3,3827,216.85,Short Sale 214 | 150335,Santa Maria-Orcutt,165000.00,2,1,1100,150.00,Short Sale 215 | 150360,Santa Maria-Orcutt,179000.00,3,2,1398,128.04,Short Sale 216 | 150390,Paso Robles,279000.00,3,2,1381,202.03,Short Sale 217 | 150392,Atascadero,820000.00,4,4,3387,242.10,Foreclosure 218 | 150394,Paso Robles,399000.00,2,1,1250,319.20,Short Sale 219 | 150407,San Miguel,164900.00,3,1,965,170.88,Short Sale 220 | 150424,Santa Maria-Orcutt,235000.00,4,2,1860,126.34,Short Sale 221 | 150439,Arroyo Grande,1900000.00,4,5,5411,351.14,Short Sale 222 | 150455,Nipomo,289000.00,3,2,1367,211.41,Short Sale 223 | 150470,Paso Robles,355000.00,3,2,1640,216.46,Short Sale 224 | 150477,Santa Maria-Orcutt,199000.00,3,2,1269,156.82,Short Sale 225 | 150482,Santa Maria-Orcutt,209000.00,3,2,1275,163.92,Short Sale 226 | 150493,Lompoc,186900.00,3,1,912,204.93,Foreclosure 227 | 150501,Santa Maria-Orcutt,240000.00,4,2,1460,164.38,Short Sale 228 | 150513,Nipomo,515000.00,2,2,2000,257.50,Short Sale 229 | 150543,Santa Maria-Orcutt,215000.00,4,2,1750,122.86,Short Sale 230 | 150556,Santa Maria-Orcutt,399900.00,4,4,3050,131.11,Short Sale 231 | 150571,Paso Robles,369000.00,4,3,2371,155.63,Short Sale 232 | 150572,Paso Robles,250000.00,2,2,1292,193.50,Short Sale 233 | 150588,Paso Robles,259000.00,3,2,1640,157.93,Short Sale 234 | 150611,Santa Maria-Orcutt,180000.00,2,2,1082,166.36,Short Sale 235 | 150636,Solvang,399900.00,3,2,1522,262.75,Short Sale 236 | 150638,Arroyo Grande,385000.00,3,2,1535,250.81,Short Sale 237 | 150669,Santa Maria-Orcutt,154000.00,2,2,1100,140.00,Short Sale 238 | 150732,San Luis Obispo,254900.00,2,2,966,263.87,Foreclosure 239 | 150744,Paso Robles,315000.00,4,2,1653,190.56,Short Sale 240 | 150746,Santa Maria-Orcutt,437500.00,3,3,2523,173.40,Short Sale 241 | 150751,Santa Maria-Orcutt,299900.00,3,3,2511,119.43,Short Sale 242 | 150773,Arroyo Grande,399000.00,3,3,1772,225.17,Short Sale 243 | 150823,Paso Robles,330000.00,3,3,1889,174.70,Short Sale 244 | 150827,Arroyo Grande,279000.00,2,2,880,317.05,Short Sale 245 | 150844,Santa Maria-Orcutt,248000.00,3,2,1400,177.14,Short Sale 246 | 150857,Santa Maria-Orcutt,209000.00,3,3,1494,139.89,Short Sale 247 | 150879,Los Osos,729000.00,3,2,1844,395.34,Short Sale 248 | 150903,Atascadero,454500.00,4,3,1900,239.21,Foreclosure 249 | 150929,Paso Robles,249000.00,3,2,1176,211.73,Short Sale 250 | 150949,Nipomo,1700000.00,3,5,4463,380.91,Short Sale 251 | 150966,Grover Beach,349000.00,3,2,1635,213.46,Short Sale 252 | 150969,Grover Beach,575000.00,3,3,2095,274.46,Short Sale 253 | 150980,Santa Maria-Orcutt,185000.00,3,2,1300,142.31,Short Sale 254 | 150981,Santa Maria-Orcutt,165000.00,3,2,1200,137.50,Short Sale 255 | 150987,Morro Bay,311900.00,0,1,910,342.75,Foreclosure 256 | 151000,Santa Maria-Orcutt,175000.00,3,2,1600,109.38,Short Sale 257 | 151005,Lompoc,180000.00,4,2,1332,135.14,Short Sale 258 | 151009,Santa Maria-Orcutt,78000.00,2,2,1680,46.43,Short Sale 259 | 151021,Oceano,142900.00,2,1,1313,108.83,Foreclosure 260 | 151071,Atascadero,850000.00,4,4,3744,227.03,Foreclosure 261 | 151078,Paso Robles,389000.00,3,2,1998,194.69,Short Sale 262 | 151080,Santa Maria-Orcutt,641900.00,3,3,2714,236.51,Foreclosure 263 | 151083,Templeton,305000.00,4,2,1797,169.73,Short Sale 264 | 151084,Paso Robles,260000.00,3,3,1687,154.12,Short Sale 265 | 151085,Paso Robles,320000.00,3,2,1663,192.42,Short Sale 266 | 151097,Atascadero,199000.00,2,1,792,251.26,Short Sale 267 | 151107,Santa Maria-Orcutt,299000.00,2,2,1410,212.06,Short Sale 268 | 151114,Buellton,289000.00,2,2,1085,266.36,Short Sale 269 | 151126,Santa Maria-Orcutt,229900.00,3,3,1900,121.00,Short Sale 270 | 151138,Atascadero,865000.00,4,3,3305,261.72,Foreclosure 271 | 151186,Atascadero,900000.00,4,4,3962,227.16,Short Sale 272 | 151187,Atascadero,199000.00,2,3,1260,157.94,Short Sale 273 | 151213,Santa Maria-Orcutt,160000.00,2,3,1200,133.33,Short Sale 274 | 151227,Santa Maria-Orcutt,299000.00,3,3,2400,124.58,Short Sale 275 | 151228,Oceano,300000.00,3,3,1265,237.15,Short Sale 276 | 151232,Santa Maria-Orcutt,270000.00,4,2,1460,184.93,Short Sale 277 | 151246,Nipomo,490000.00,3,3,1894,258.71,Short Sale 278 | 151249,Santa Maria-Orcutt,295000.00,3,3,1800,163.89,Short Sale 279 | 151257,Paso Robles,225000.00,3,2,1550,145.16,Short Sale 280 | 151277,Atascadero,324900.00,2,2,1426,227.84,Short Sale 281 | 151293,Santa Maria-Orcutt,165000.00,3,2,1110,148.65,Short Sale 282 | 151296,Santa Maria-Orcutt,157900.00,3,2,1075,146.88,Short Sale 283 | 151304,Nipomo,299000.00,3,2,1756,170.27,Short Sale 284 | 151308,Paso Robles,369000.00,3,3,2150,171.63,Short Sale 285 | 151373,Santa Maria-Orcutt,233000.00,4,2,1650,141.21,Short Sale 286 | 151395,Santa Maria-Orcutt,109900.00,2,2,1200,91.58,Foreclosure 287 | 151402,Paso Robles,309000.00,3,2,1488,207.66,Short Sale 288 | 151419,Pismo Beach,1799000.00,4,4,3609,498.48,Foreclosure 289 | 151441,Santa Maria-Orcutt,209900.00,2,2,1113,188.59,Short Sale 290 | 151443,Solvang,499000.00,3,2,1600,311.88,Short Sale 291 | 151451,Arroyo Grande,525000.00,4,2,1961,267.72,Short Sale 292 | 151454,Los Osos,650000.00,3,3,3249,200.06,Short Sale 293 | 151470,Morro Bay,529000.00,3,3,1510,350.33,Short Sale 294 | 151498,Santa Maria-Orcutt,179000.00,3,2,1300,137.69,Short Sale 295 | 151521,Lompoc,282000.00,3,3,1736,162.44,Short Sale 296 | 151527,Templeton,899000.00,4,3,3008,298.87,Short Sale 297 | 151534,Santa Maria-Orcutt,130000.00,3,2,1850,70.27,Short Sale 298 | 151636,Santa Maria-Orcutt,205000.00,3,2,1146,178.88,Short Sale 299 | 151640,Santa Maria-Orcutt,180900.00,2,2,1100,164.45,Short Sale 300 | 151647,Atascadero,409900.00,4,4,2135,191.99,Short Sale 301 | 151648,Atascadero,409900.00,4,4,2135,191.99,Short Sale 302 | 151678,Grover Beach,469000.00,3,2,1827,256.70,Short Sale 303 | 151681,Arroyo Grande,289000.00,3,1,1005,287.56,Short Sale 304 | 151690,Santa Maria-Orcutt,99999.00,2,3,1800,55.56,Short Sale 305 | 151700,Santa Maria-Orcutt,445000.00,5,3,3307,134.56,Foreclosure 306 | 151711,Atascadero,640000.00,3,3,2160,296.30,Short Sale 307 | 151724,San Miguel,185000.00,3,2,1062,174.20,Short Sale 308 | 151732,Santa Maria-Orcutt,210000.00,4,2,1102,190.56,Short Sale 309 | 151772,Santa Maria-Orcutt,199900.00,3,2,1215,164.53,Short Sale 310 | 151805,Santa Maria-Orcutt,225000.00,3,2,1600,140.63,Short Sale 311 | 151816,Paso Robles,369900.00,4,2,2161,171.17,Foreclosure 312 | 151824,Santa Maria-Orcutt,120000.00,3,2,1686,71.17,Short Sale 313 | 151826,Paso Robles,199000.00,2,1,1000,199.00,Short Sale 314 | 151832,Arroyo Grande,520000.00,3,3,2600,200.00,Short Sale 315 | 151837,Paso Robles,579000.00,5,3,3150,183.81,Foreclosure 316 | 151854,Santa Maria-Orcutt,300000.00,4,2,1257,238.66,Short Sale 317 | 151857,Arroyo Grande,325000.00,3,2,1171,277.54,Short Sale 318 | 151864,Santa Maria-Orcutt,225000.00,3,2,1144,196.68,Short Sale 319 | 151870,Atascadero,395000.00,2,1,1160,340.52,Short Sale 320 | 151871,Santa Maria-Orcutt,399000.00,4,3,2300,173.48,Short Sale 321 | 151876,Lompoc,165000.00,3,2,1144,144.23,Short Sale 322 | 151882,Arroyo Grande,374900.00,3,2,1368,274.05,Short Sale 323 | 151903,Santa Maria-Orcutt,199900.00,3,2,1238,161.47,Short Sale 324 | 151913,Arroyo Grande,365000.00,3,1,1056,345.64,Short Sale 325 | 151925,Santa Maria-Orcutt,222900.00,2,2,1086,205.25,Short Sale 326 | 151932,Los Osos,249900.00,2,1,720,347.08,Foreclosure 327 | 151934,Paso Robles,290000.00,3,2,1426,203.37,Short Sale 328 | 151940,Santa Maria-Orcutt,170500.00,4,2,1361,125.28,Short Sale 329 | 151942,Atascadero,560000.00,3,3,2344,238.91,Short Sale 330 | 151952,Nipomo,339900.00,4,2,1925,176.57,Short Sale 331 | 151967,Nipomo,550000.00,4,3,2600,211.54,Short Sale 332 | 151991,San Miguel,269900.00,4,2,1601,168.58,Short Sale 333 | 151994,Paso Robles,350000.00,3,2,1395,250.90,Short Sale 334 | 151996,Los Osos,214000.00,2,2,1042,205.37,Foreclosure 335 | 152002,Santa Maria-Orcutt,299900.00,3,2,1200,249.92,Short Sale 336 | 152003,Nipomo,139500.00,2,2,1248,111.78,Foreclosure 337 | 152006,Lompoc,360000.00,4,3,3000,120.00,Short Sale 338 | 152014,Paso Robles,315000.00,3,2,1300,242.31,Short Sale 339 | 152019,Paso Robles,279900.00,3,2,1244,225.00,Foreclosure 340 | 152024,Paso Robles,399000.00,4,2,2139,186.54,Short Sale 341 | 152036,Atascadero,475000.00,4,3,2450,193.88,Short Sale 342 | 152037,Santa Maria-Orcutt,65900.00,2,2,840,78.45,Foreclosure 343 | 152048,Coalinga,212000.00,4,3,1878,112.89,Short Sale 344 | 152068,San Miguel,180000.00,3,2,1350,133.33,Short Sale 345 | 152075,Santa Maria-Orcutt,210000.00,4,2,1377,152.51,Short Sale 346 | 152078,Buellton,375000.00,3,3,1475,254.24,Short Sale 347 | 152109,Atascadero,106900.00,2,2,894,119.57,Foreclosure 348 | 152116,Paso Robles,221830.00,3,2,1550,143.12,Short Sale 349 | 152122,Nipomo,239000.00,3,2,1106,216.09,Short Sale 350 | 152131,Atascadero,187500.00,1,1,594,315.66,Short Sale 351 | 152137,Los Alamos,445000.00,5,3,3200,139.06,Short Sale 352 | 152139,Santa Maria-Orcutt,309000.00,3,2,1906,162.12,Short Sale 353 | 152152,Santa Maria-Orcutt,315000.00,3,2,2004,157.19,Short Sale 354 | 152154,Santa Maria-Orcutt,191100.00,3,1,1200,159.25,Foreclosure 355 | 152163,Cambria,699900.00,5,3,1818,384.98,Foreclosure 356 | 152190,Nipomo,189500.00,2,2,1040,182.21,Short Sale 357 | 152191,Santa Maria-Orcutt,199000.00,4,2,1400,142.14,Short Sale 358 | 152196,Santa Maria-Orcutt,359000.00,4,3,2209,162.52,Short Sale 359 | 152203,Atascadero,264450.00,3,1,1030,256.75,Short Sale 360 | 152213,Templeton,459000.00,3,2,1999,229.61,Short Sale 361 | 152227,Santa Maria-Orcutt,150000.00,3,2,1316,113.98,Short Sale 362 | 152228,Pismo Beach,875000.00,3,3,2200,397.73,Short Sale 363 | 152233,Pismo Beach,599000.00,2,2,1200,499.17,Short Sale 364 | 152263,Atascadero,250000.00,3,3,1261,198.26,Short Sale 365 | 152265,Lompoc,165000.00,3,2,1120,147.32,Short Sale 366 | 152272,Santa Maria-Orcutt,229900.00,4,3,1857,123.80,Short Sale 367 | 152277,Santa Maria-Orcutt,229900.00,3,2,1400,164.21,Short Sale 368 | 152291,Paso Robles,269900.00,3,2,1139,236.96,Short Sale 369 | 152298,Santa Maria-Orcutt,245000.00,5,3,6098,40.18,Short Sale 370 | 152320,Santa Maria-Orcutt,165000.00,3,2,1300,126.92,Short Sale 371 | 152326,Lompoc,429000.00,3,3,2041,210.19,Short Sale 372 | 152340,Santa Maria-Orcutt,309900.00,4,3,2248,137.86,Short Sale 373 | 152351,Arroyo Grande,265000.00,2,1,972,272.63,Foreclosure 374 | 152359,Santa Maria-Orcutt,169900.00,4,2,1500,113.27,Short Sale 375 | 152360,Santa Maria-Orcutt,380900.00,3,2,2000,190.45,Short Sale 376 | 152384,Santa Maria-Orcutt,315000.00,4,3,1939,162.45,Short Sale 377 | 152393,Lompoc,260000.00,3,2,1413,184.01,Short Sale 378 | 152395,Santa Maria-Orcutt,119900.00,3,2,1312,91.39,Short Sale 379 | 152396,Santa Maria-Orcutt,211500.00,3,2,1275,165.88,Foreclosure 380 | 152401,Santa Maria-Orcutt,149000.00,2,1,854,174.47,Short Sale 381 | 152405,San Luis Obispo,890000.00,3,3,3474,256.19,Short Sale 382 | 152410,Cambria,289900.00,3,2,1380,210.07,Foreclosure 383 | 152459,Santa Maria-Orcutt,289000.00,4,3,2100,137.62,Short Sale 384 | 152487,Oceano,399900.00,3,2,1487,268.93,Short Sale 385 | 152491,Santa Maria-Orcutt,125000.00,3,2,900,138.89,Short Sale 386 | 152496,Nipomo,359900.00,5,3,3036,118.54,Short Sale 387 | 152515,Santa Maria-Orcutt,239000.00,3,3,1800,132.78,Short Sale 388 | 152525,Santa Maria-Orcutt,199900.00,3,3,1600,124.94,Short Sale 389 | 152533,Santa Maria-Orcutt,179900.00,4,3,2150,83.67,Short Sale 390 | 152565,Santa Maria-Orcutt,195000.00,3,2,1300,150.00,Short Sale 391 | 152570,San Luis Obispo,299000.00,2,2,896,333.71,Foreclosure 392 | 152581,Santa Maria-Orcutt,265000.00,2,3,1700,155.88,Short Sale 393 | 152586,Nipomo,699000.00,3,2,1700,411.18,Foreclosure 394 | 152597,Grover Beach,275000.00,2,2,1194,230.32,Short Sale 395 | 152617,Paso Robles,169990.00,3,2,1465,116.03,Foreclosure 396 | 152619,Santa Maria-Orcutt,189000.00,3,3,1530,123.53,Short Sale 397 | 152638,Santa Ynez,695000.00,4,2,2032,342.03,Foreclosure 398 | 152670,Santa Maria-Orcutt,105000.00,2,2,1088,96.51,Short Sale 399 | 152675,Santa Maria-Orcutt,365000.00,4,4,4000,91.25,Short Sale 400 | 152677,Paso Robles,335900.00,3,3,1296,259.18,Foreclosure 401 | 152683,Lompoc,170000.00,3,2,944,180.08,Short Sale 402 | 152705,Santa Maria-Orcutt,339900.00,4,2,2100,161.86,Short Sale 403 | 152716,Santa Maria-Orcutt,359900.00,3,3,2340,153.80,Short Sale 404 | 152718,Santa Maria-Orcutt,143000.00,3,2,1080,132.41,Short Sale 405 | 152720,Santa Maria-Orcutt,199000.00,3,2,1196,166.39,Short Sale 406 | 152727,San Luis Obispo,374800.00,3,3,1365,274.58,Short Sale 407 | 152757,Los Osos,499000.00,3,2,2120,235.38,Short Sale 408 | 152764,Atascadero,138900.00,2,1,1055,131.66,Foreclosure 409 | 152768,Avila Beach,1999000.00,4,5,5307,376.67,Short Sale 410 | 152771,Paso Robles,359000.00,3,2,1774,202.37,Short Sale 411 | 152772,Santa Maria-Orcutt,294900.00,4,2,1856,158.89,Short Sale 412 | 152773,Atascadero,299500.00,4,2,1836,163.13,Foreclosure 413 | 152778,Santa Maria-Orcutt,427900.00,4,3,2367,180.78,Short Sale 414 | 152781,Nipomo,269000.00,3,2,1181,227.77,Short Sale 415 | 152784,Bradley,449000.00,3,3,2563,175.19,Short Sale 416 | 152792,Santa Maria-Orcutt,144900.00,2,2,1130,128.23,Foreclosure 417 | 152794,Santa Maria-Orcutt,345000.00,3,3,2020,170.79,Short Sale 418 | 152800,Paso Robles,239000.00,4,2,1240,192.74,Short Sale 419 | 152805,Los Osos,310000.00,2,1,780,397.44,Short Sale 420 | 152806,Santa Maria-Orcutt,225000.00,3,3,1800,125.00,Short Sale 421 | 152809,Paso Robles,695000.00,5,6,3750,185.33,Short Sale 422 | 152820,Nipomo,242500.00,3,3,1650,146.97,Short Sale 423 | 152844,Arroyo Grande,249250.00,2,1,728,342.38,Short Sale 424 | 152849,Grover Beach,479000.00,3,2,1462,327.63,Short Sale 425 | 152854,Lompoc,169900.00,3,2,1150,147.74,Foreclosure 426 | 152856,Santa Maria-Orcutt,219900.00,3,3,1660,132.47,Short Sale 427 | 152887,Paso Robles,150000.00,2,2,1440,104.17,Short Sale 428 | 152888,Nipomo,649000.00,4,2,1814,357.77,Foreclosure 429 | 152890,Santa Maria-Orcutt,285000.00,4,3,2100,135.71,Short Sale 430 | 152893,Paso Robles,163999.00,3,2,1488,110.21,Short Sale 431 | 152897,Nipomo,349000.00,4,2,1718,203.14,Short Sale 432 | 152900,Buellton,409900.00,3,2,1716,238.87,Foreclosure 433 | 152906,Los Osos,275000.00,3,2,1320,208.33,Short Sale 434 | 152912,Santa Maria-Orcutt,179900.00,3,2,1200,149.92,Foreclosure 435 | 152914,Oceano,789000.00,3,3,2218,355.73,Short Sale 436 | 152937,Santa Maria-Orcutt,299000.00,4,3,1768,169.12,Short Sale 437 | 152948,Arroyo Grande,850000.00,5,4,3588,236.90,Foreclosure 438 | 152964,Santa Maria-Orcutt,295900.00,3,2,1776,166.61,Short Sale 439 | 152967,Santa Maria-Orcutt,199000.00,4,3,1467,135.65,Short Sale 440 | 152969,Santa Maria-Orcutt,199900.00,3,3,1950,102.51,Short Sale 441 | 152978,Santa Maria-Orcutt,179900.00,3,2,1288,139.67,Foreclosure 442 | 152987,Atascadero,290000.00,3,3,1733,167.34,Short Sale 443 | 152989,Santa Maria-Orcutt,168000.00,3,2,1128,148.94,Short Sale 444 | 152998,Santa Maria-Orcutt,270000.00,3,3,1900,142.11,Short Sale 445 | 152999,Los Osos,1249000.00,6,7,5103,244.76,Foreclosure 446 | 153000,Santa Maria-Orcutt,240000.00,3,2,1255,191.24,Short Sale 447 | 153014,Coalinga,219500.00,5,2,1802,121.81,Short Sale 448 | 153032,Santa Maria-Orcutt,235000.00,4,3,2336,100.60,Short Sale 449 | 153036,San Luis Obispo,239800.00,2,2,1190,201.51,Foreclosure 450 | 153042,Santa Maria-Orcutt,269000.00,3,3,1800,149.44,Short Sale 451 | 153047,Paso Robles,319200.00,4,3,2006,159.12,Foreclosure 452 | 153052,Paso Robles,402500.00,3,2,2446,164.55,Foreclosure 453 | 153068,Paso Robles,425000.00,3,2,2114,201.04,Short Sale 454 | 153084,Atascadero,669000.00,3,3,2600,257.31,Short Sale 455 | 153085,Atascadero,369000.00,3,2,1514,243.73,Short Sale 456 | 153088,Paso Robles,239900.00,3,2,1080,222.13,Foreclosure 457 | 153095,Grover Beach,249500.00,2,2,1088,229.32,Short Sale 458 | 153116,Solvang,557000.00,4,2,1809,307.90,Short Sale 459 | 153119,Santa Maria-Orcutt,339900.00,6,3,2053,165.56,Foreclosure 460 | 153127,Nipomo,149900.00,2,2,969,154.70,Short Sale 461 | 153133,Arroyo Grande,849900.00,3,4,3375,251.82,Short Sale 462 | 153134,Lompoc,307000.00,3,2,1594,192.60,Foreclosure 463 | 153157,Santa Maria-Orcutt,259000.00,4,3,1900,136.32,Short Sale 464 | 153160,Santa Maria-Orcutt,165000.00,3,2,1050,157.14,Short Sale 465 | 153168,Santa Maria-Orcutt,289900.00,3,2,1414,205.02,Foreclosure 466 | 153175,Nipomo,879000.00,3,4,3698,237.70,Short Sale 467 | 153179,Santa Maria-Orcutt,220000.00,3,2,1200,183.33,Short Sale 468 | 153185,Atascadero,309000.00,3,3,1685,183.38,Short Sale 469 | 153197,Paso Robles,580000.00,3,3,2271,255.39,Short Sale 470 | 153207,Santa Maria-Orcutt,459900.00,2,2,1150,399.91,Short Sale 471 | 153214,Santa Maria-Orcutt,299000.00,5,3,2481,120.52,Short Sale 472 | 153230,Santa Maria-Orcutt,309900.00,4,3,1600,193.69,Short Sale 473 | 153234,Paso Robles,287000.00,3,2,1269,226.16,Short Sale 474 | 153259,Grover Beach,310000.00,3,2,1200,258.33,Short Sale 475 | 153264,Atascadero,229900.00,3,2,1198,191.90,Foreclosure 476 | 153268,Buellton,377000.00,3,2,1363,276.60,Foreclosure 477 | 153276,Lompoc,295000.00,4,2,1973,149.52,Short Sale 478 | 153288,Santa Maria-Orcutt,225000.00,3,2,1516,148.42,Short Sale 479 | 153294,Santa Maria-Orcutt,130000.00,3,2,1080,120.37,Short Sale 480 | 153314,Santa Maria-Orcutt,169990.00,2,1,920,184.77,Short Sale 481 | 153327,Santa Maria-Orcutt,145000.00,3,2,1027,141.19,Foreclosure 482 | 153343,Greenfield,184800.00,4,2,2018,91.58,Foreclosure 483 | 153370,Santa Maria-Orcutt,189900.00,3,2,1253,151.56,Foreclosure 484 | 153371,Santa Maria-Orcutt,249000.00,3,2,1062,234.46,Short Sale 485 | 153377,Santa Maria-Orcutt,185000.00,4,2,1934,95.66,Short Sale 486 | 153382,Atascadero,145000.00,2,2,1041,139.29,Short Sale 487 | 153384,Paso Robles,429000.00,5,3,2700,158.89,Foreclosure 488 | 153406,Arroyo Grande,419000.00,2,2,1587,264.02,Short Sale 489 | 153411,Santa Maria-Orcutt,245000.00,3,3,1859,131.79,Short Sale 490 | 153425,Santa Maria-Orcutt,289900.00,4,3,2400,120.79,Short Sale 491 | 153428,Santa Maria-Orcutt,175000.00,3,2,1110,157.66,Short Sale 492 | 153432,Santa Maria-Orcutt,139000.00,3,2,1075,129.30,Short Sale 493 | 153442,Arroyo Grande,514900.00,4,3,2035,253.02,Foreclosure 494 | 153447,Pismo Beach,549000.00,3,2,1858,295.48,Short Sale 495 | 153464,Atascadero,235000.00,3,3,1261,186.36,Short Sale 496 | 153480,Atascadero,399000.00,6,3,2628,151.83,Foreclosure 497 | 153500,Los Osos,259900.00,3,2,1120,232.05,Short Sale 498 | 153513,Lompoc,350900.00,3,2,1686,208.13,Foreclosure 499 | 153516,Nipomo,1399900.00,4,4,5190,269.73,Short Sale 500 | 153543,Santa Maria-Orcutt,399000.00,3,2,1840,216.85,Short Sale 501 | 153547,Solvang,399000.00,3,2,1204,331.40,Short Sale 502 | 153552,Atascadero,199000.00,2,1,973,204.52,Short Sale 503 | 153556,Santa Maria-Orcutt,350000.00,3,2,1622,215.78,Short Sale 504 | 153565,Nipomo,296800.00,4,2,2125,139.67,Foreclosure 505 | 153570,Santa Maria-Orcutt,165000.00,3,2,1204,137.04,Short Sale 506 | 153576,Santa Maria-Orcutt,210000.00,3,3,1750,120.00,Short Sale 507 | 153606,San Miguel,229000.00,3,2,1458,157.06,Short Sale 508 | 153633,San Miguel,199500.00,3,2,1184,168.50,Short Sale 509 | 153639,Santa Maria-Orcutt,110000.00,3,2,1000,110.00,Short Sale 510 | 153647,Paso Robles,264900.00,3,3,1197,221.30,Foreclosure 511 | 153656,Atascadero,449900.00,3,3,2135,210.73,Foreclosure 512 | 153668,Santa Maria-Orcutt,159900.00,3,2,1114,143.54,Short Sale 513 | 153692,Paso Robles,429000.00,4,2,1870,229.41,Short Sale 514 | 153693,Grover Beach,265000.00,1,1,566,468.20,Short Sale 515 | 153697,Nipomo,279900.00,2,2,1134,246.83,Short Sale 516 | 153710,Santa Maria-Orcutt,174900.00,3,2,1100,159.00,Foreclosure 517 | 153719,Lompoc,158900.00,4,2,1144,138.90,Foreclosure 518 | 153734,Santa Maria-Orcutt,150000.00,3,2,1349,111.19,Short Sale 519 | 153738,Buellton,269000.00,3,3,1281,209.99,Short Sale 520 | 153746,Atascadero,489900.00,3,3,1957,250.33,Foreclosure 521 | 153757,Santa Maria-Orcutt,256000.00,4,2,1174,218.06,Short Sale 522 | 153768,Atascadero,335000.00,4,3,2400,139.58,Short Sale 523 | 153769,Morro Bay,435000.00,3,2,1236,351.94,Short Sale 524 | 153774,Santa Maria-Orcutt,280000.00,3,3,1910,146.60,Short Sale 525 | 153779,Paso Robles,409000.00,4,2,2064,198.16,Foreclosure 526 | 153780,Paso Robles,409000.00,4,2,2064,198.16,Foreclosure 527 | 153781,Paso Robles,399000.00,4,3,1888,211.33,Foreclosure 528 | 153783,Paso Robles,389000.00,4,2,1862,208.92,Foreclosure 529 | 153785,Nipomo,222600.00,3,2,1106,201.27,Foreclosure 530 | 153791,Santa Maria-Orcutt,140000.00,3,2,1200,116.67,Short Sale 531 | 153799,Soledad,220000.00,5,3,2408,91.36,Foreclosure 532 | 153800,Nipomo,650000.00,3,3,2703,240.47,Short Sale 533 | 153802,Lompoc,405000.00,3,2,1728,234.38,Short Sale 534 | 153807,Paso Robles,409000.00,3,2,1960,208.67,Foreclosure 535 | 153828,Santa Maria-Orcutt,164900.00,3,2,1092,151.01,Foreclosure 536 | 153839,Santa Margarita,59900.00,1,1,628,95.38,Foreclosure 537 | 153850,Santa Maria-Orcutt,199900.00,3,2,1275,156.78,Short Sale 538 | 153864,Atascadero,95000.00,2,1,756,125.66,Foreclosure 539 | 153865,Oceano,170000.00,2,2,885,192.09,Short Sale 540 | 153866,San Miguel,720000.00,4,4,3531,203.91,Foreclosure 541 | 153872,Santa Maria-Orcutt,204000.00,3,2,1712,119.16,Short Sale 542 | 153876,Santa Maria-Orcutt,220000.00,3,2,1100,200.00,Short Sale 543 | 153881,Buellton,498900.00,4,3,1500,332.60,Foreclosure 544 | 153900,Santa Maria-Orcutt,229900.00,3,2,1671,137.58,Short Sale 545 | 153915,San Luis Obispo,531905.00,3,2,1668,318.89,Foreclosure 546 | 153923,Santa Maria-Orcutt,114900.00,2,1,775,148.26,Foreclosure 547 | 153927,Guadalupe,145000.00,3,2,1200,120.83,Short Sale 548 | 153939,Lompoc,191330.00,4,2,1237,154.67,Foreclosure 549 | 153944,Lompoc,199900.00,4,2,1338,149.40,Short Sale 550 | 153949,Santa Maria-Orcutt,266800.00,4,3,2100,127.05,Short Sale 551 | 153953,San Miguel,84900.00,2,2,1222,69.48,Foreclosure 552 | 153955,Santa Maria-Orcutt,250000.00,3,2,1807,138.35,Short Sale 553 | 153960,Santa Maria-Orcutt,220000.00,4,2,1352,162.72,Short Sale 554 | 153971,Lompoc,227900.00,3,2,1503,151.63,Foreclosure 555 | 153997,Buellton,384900.00,4,2,1571,245.00,Foreclosure 556 | 154005,Paso Robles,529000.00,4,3,2502,211.43,Short Sale 557 | 154006,Santa Maria-Orcutt,159900.00,3,2,1526,104.78,Foreclosure 558 | 154010,Atascadero,199000.00,3,2,1007,197.62,Short Sale 559 | 154015,Lompoc,125000.00,3,3,1306,95.71,Foreclosure 560 | 154028,Bakersfield,91500.00,3,2,1313,69.69,Short Sale 561 | 154034,Santa Maria-Orcutt,155000.00,3,2,1593,97.30,Short Sale 562 | 154038,Paso Robles,409000.00,3,3,2203,185.66,Short Sale 563 | 154044,Atascadero,949000.00,5,4,5200,182.50,Short Sale 564 | 154048,Atascadero,90000.00,2,1,756,119.05,Short Sale 565 | 154058,Santa Maria-Orcutt,300000.00,3,3,2328,128.87,Foreclosure 566 | 154060,Santa Maria-Orcutt,179900.00,3,2,1008,178.47,Short Sale 567 | 154066,Grover Beach,349000.00,3,2,1346,259.29,Short Sale 568 | 154071,Nipomo,220000.00,3,2,1112,197.84,Foreclosure 569 | 154074,Santa Maria-Orcutt,155000.00,3,2,1340,115.67,Short Sale 570 | 154075,Paso Robles,390000.00,4,2,2236,174.42,Short Sale 571 | 154090,Santa Maria-Orcutt,425000.00,5,4,3039,139.85,Short Sale 572 | 154091,Santa Maria-Orcutt,249900.00,3,2,1733,144.20,Short Sale 573 | 154092,Santa Maria-Orcutt,239000.00,4,3,1947,122.75,Short Sale 574 | 154111,Buellton,395000.00,4,3,1868,211.46,Short Sale 575 | 154113,Buellton,375000.00,3,3,1475,254.24,Short Sale 576 | 154115,Buellton,395000.00,4,3,1868,211.46,Short Sale 577 | 154116,Buellton,395000.00,4,3,1868,211.46,Short Sale 578 | 154119,Santa Maria-Orcutt,230000.00,4,3,1927,119.36,Short Sale 579 | 154131,Santa Maria-Orcutt,189000.00,3,2,1292,146.28,Foreclosure 580 | 154136,Paso Robles,304900.00,3,2,1657,184.01,Foreclosure 581 | 154145,Santa Maria-Orcutt,169900.00,3,2,1300,130.69,Foreclosure 582 | 154147,Santa Maria-Orcutt,286500.00,3,2,1700,168.53,Short Sale 583 | 154153,San Miguel,325000.00,4,2,2400,135.42,Short Sale 584 | 154154,Grover Beach,375000.00,3,2,1278,293.43,Short Sale 585 | 154159,Paso Robles,278000.00,3,2,1396,199.14,Foreclosure 586 | 154161,Paso Robles,149000.00,3,2,1368,108.92,Short Sale 587 | 154167,Santa Maria-Orcutt,209000.00,3,2,1520,137.50,Short Sale 588 | 154169,Santa Maria-Orcutt,95000.00,2,2,900,105.56,Short Sale 589 | 154171,Santa Maria-Orcutt,199900.00,3,2,1407,142.08,Short Sale 590 | 154175,Santa Maria-Orcutt,185000.00,3,2,1170,158.12,Short Sale 591 | 154182,Lompoc,449900.00,4,3,3035,148.24,Foreclosure 592 | 154197,Santa Maria-Orcutt,310000.00,5,4,2900,106.90,Short Sale 593 | 154199,Santa Maria-Orcutt,239900.00,4,2,1656,144.87,Short Sale 594 | 154200,Santa Maria-Orcutt,187900.00,2,2,980,191.73,Foreclosure 595 | 154201,Arroyo Grande,450000.00,3,2,1916,234.86,Short Sale 596 | 154205,San Luis Obispo,440000.00,3,3,1756,250.57,Short Sale 597 | 154223,Santa Maria-Orcutt,260000.00,3,2,1278,203.44,Short Sale 598 | 154233,New Cuyama,40900.00,3,1,1201,34.05,Short Sale 599 | 154241,Paso Robles,249000.00,3,2,1275,195.29,Short Sale 600 | 154242,Atascadero,349000.00,3,3,2000,174.50,Short Sale 601 | 154244,Santa Maria-Orcutt,175000.00,3,2,1200,145.83,Short Sale 602 | 154246,Atascadero,449970.00,3,2,2000,224.99,Foreclosure 603 | 154254,Grover Beach,419000.00,3,2,1902,220.29,Short Sale 604 | 154257,Arroyo Grande,400000.00,3,3,1568,255.10,Short Sale 605 | 154259,Santa Maria-Orcutt,185000.00,3,2,1257,147.18,Short Sale 606 | 154276,Santa Maria-Orcutt,139900.00,2,2,1100,127.18,Short Sale 607 | 154279,Santa Maria-Orcutt,174900.00,3,2,1461,119.71,Foreclosure 608 | 154283,Soledad,165360.00,4,2,1353,122.22,Foreclosure 609 | 154284,Santa Maria-Orcutt,169000.00,3,2,1200,140.83,Short Sale 610 | 154298,Santa Maria-Orcutt,240000.00,3,3,2039,117.70,Short Sale 611 | 154304,Santa Maria-Orcutt,364000.00,4,3,2150,169.30,Short Sale 612 | 154308,Arroyo Grande,250000.00,1,1,748,334.22,Short Sale 613 | 154309,Santa Maria-Orcutt,299900.00,4,3,1969,152.31,Foreclosure 614 | 154311,Santa Maria-Orcutt,281900.00,4,3,2357,119.60,Foreclosure 615 | 154312,Grover Beach,349900.00,3,1,1522,229.89,Short Sale 616 | 154317,Santa Maria-Orcutt,220000.00,3,2,1850,118.92,Short Sale 617 | 154320,Templeton,774800.00,3,4,3123,248.09,Foreclosure 618 | 154322,Santa Maria-Orcutt,135000.00,3,2,1200,112.50,Short Sale 619 | 154325, Lompoc,149900.00,3,1,1000,149.90,Regular 620 | 154327,Paso Robles,599000.00,3,2,2082,287.70,Foreclosure 621 | 154328,Santa Maria-Orcutt,179000.00,3,2,1200,149.17,Foreclosure 622 | 154329,Santa Maria-Orcutt,177000.00,3,2,1500,118.00,Foreclosure 623 | 154329,Santa Maria-Orcutt,177000.00,3,2,1500,118.00,Regular 624 | 154330, Nipomo,122500.00,4,2,1248,98.16,Regular 625 | 154332,Santa Maria-Orcutt,239500.00,3,2,1400,171.07,Short Sale 626 | 154335,Paso Robles,214900.00,3,2,1080,198.98,Foreclosure 627 | 154338,Santa Maria-Orcutt,275000.00,3,2,1460,188.36,Short Sale 628 | 154343, Arroyo Grande,425000.00,3,2,1437,295.76,Regular 629 | 154344,San Simeon,274900.00,2,2,1218,225.70,Foreclosure 630 | 154345, Nipomo,175000.00,2,2,1152,151.91,Regular 631 | 154346, Morro Bay,535000.00,2,2,1410,379.43,Regular 632 | 154347, Pismo Beach,540000.00,2,1,817,660.95,Regular 633 | 154348, Cambria,389000.00,2,2,703,553.34,Regular 634 | 154350,Paso Robles,250000.00,3,2,1425,175.44,Short Sale 635 | 154352, Paso Robles,425000.00,3,2,1807,235.20,Regular 636 | 154353, Out Of Area,1195000.00,5,4,3800,314.47,Regular 637 | 154354, Los Osos,1350000.00,3,3,2502,539.57,Regular 638 | 154356,Santa Maria-Orcutt,78500.00,1,1,800,98.13,Foreclosure 639 | 154357, Paso Robles,549000.00,3,2,2237,245.42,Regular 640 | 154358, Santa Maria-Orcutt,399900.00,4,2,1860,215.00,Regular 641 | 154359,Atascadero,699000.00,10,11,4905,142.51,Short Sale 642 | 154360, Santa Maria-Orcutt,129000.00,2,2,1200,107.50,Regular 643 | 154361, Cambria,480000.00,2,2,1698,282.69,Regular 644 | 154363,Nipomo,189000.00,3,1,1022,184.93,Foreclosure 645 | 154365, Pismo Beach,639900.00,3,2,2080,307.64,Regular 646 | 154366, Santa Maria-Orcutt,699900.00,5,4,3000,233.30,Regular 647 | 154367, Grover Beach,999000.00,3,3,3621,275.89,Regular 648 | 154370, Arroyo Grande,599000.00,3,2,1570,381.53,Regular 649 | 154371, Santa Maria-Orcutt,365000.00,4,2,1860,196.24,Regular 650 | 154372,Cambria,359900.00,3,2,1840,195.60,Foreclosure 651 | 154373, Arroyo Grande,995000.00,4,4,3740,266.04,Regular 652 | 154374,Lompoc,193450.00,4,2,1217,158.96,Foreclosure 653 | 154376,Santa Maria-Orcutt,179900.00,3,3,1520,118.36,Short Sale 654 | 154378,Grover Beach,329900.00,3,2,1240,266.05,Short Sale 655 | 154379, Templeton,509000.00,3,2,1936,262.91,Regular 656 | 154380, Atascadero,995000.00,3,3,2044,486.79,Regular 657 | 154381, Pismo Beach,545000.00,3,2,1946,280.06,Regular 658 | 154382, Pismo Beach,795000.00,3,3,2028,392.01,Regular 659 | 154383, Atascadero,830000.00,4,3,2700,307.41,Regular 660 | 154384, Arroyo Grande,54500.00,2,1,624,87.34,Regular 661 | 154385, Arroyo Grande,149000.00,3,2,1800,82.78,Regular 662 | 154386, Santa Maria-Orcutt,36000.00,2,2,1056,34.09,Regular 663 | 154387, Paso Robles,349000.00,3,2,1467,237.90,Regular 664 | 154389,Santa Maria-Orcutt,299900.00,4,3,2150,139.49,Short Sale 665 | 154390, Morro Bay,469000.00,4,2,2004,234.03,Regular 666 | 154393, Oceano,1195000.00,2,2,1044,1144.64,Regular 667 | 154394,Solvang,419900.00,3,2,1576,266.43,Foreclosure 668 | 154397, Los Osos,189000.00,2,2,1536,123.05,Regular 669 | 154398,Lompoc,163900.00,3,2,1082,151.48,Foreclosure 670 | 154399,Lompoc,163900.00,3,2,1237,132.50,Foreclosure 671 | 154400, Los Osos,648000.00,3,3,2193,295.49,Regular 672 | 154401,Santa Maria-Orcutt,130000.00,3,2,1022,127.20,Short Sale 673 | 154402,Atascadero,264900.00,3,2,1232,215.02,Foreclosure 674 | 154407,Santa Maria-Orcutt,189900.00,4,2,1435,132.33,Foreclosure 675 | 154408,Santa Maria-Orcutt,200000.00,4,2,1430,139.86,Short Sale 676 | 154410, Arroyo Grande,1249000.00,3,3,2480,503.63,Regular 677 | 154412, Cayucos,525000.00,3,3,1832,286.57,Regular 678 | 154413, Cambria,729000.00,3,3,1953,373.27,Regular 679 | 154414,Santa Maria-Orcutt,109900.00,3,2,1100,99.91,Foreclosure 680 | 154415, Santa Maria-Orcutt,850000.00,3,2,2481,342.60,Regular 681 | 154417,Santa Maria-Orcutt,249500.00,3,2,1704,146.42,Short Sale 682 | 154418,Oceano,179900.00,3,2,1161,154.95,Foreclosure 683 | 154419, Los Osos,149000.00,3,2,1440,103.47,Regular 684 | 154420, Creston,549000.00,3,2,1701,322.75,Regular 685 | 154421, Atascadero,435000.00,3,2,1536,283.20,Regular 686 | 154422, Atascadero,299000.00,3,2,1310,228.24,Regular 687 | 154423, Los Osos,625000.00,3,2,2187,285.78,Regular 688 | 154425,Santa Maria-Orcutt,399000.00,4,3,2100,190.00,Short Sale 689 | 154427,Out Of Area,186900.00,4,2,1511,123.69,Regular 690 | 154428, Cambria,1290000.00,3,3,2130,605.63,Regular 691 | 154429,Solvang,264900.00,2,3,1400,189.21,Foreclosure 692 | 154430,Lompoc,198900.00,3,2,1225,162.37,Foreclosure 693 | 154432, Paso Robles,318000.00,3,3,1868,170.24,Regular 694 | 154434, Cambria,2000000.00,4,4,3576,559.28,Regular 695 | 154435, Cambria,598000.00,2,3,2219,269.49,Regular 696 | 154437,Paso Robles,439900.00,3,3,2508,175.40,Foreclosure 697 | 154441, Pismo Beach,920000.00,3,3,2817,326.59,Regular 698 | 154442,Santa Maria-Orcutt,179900.00,3,2,1972,91.23,Short Sale 699 | 154443,Templeton,325000.00,2,1,952,341.39,Short Sale 700 | 154444, Grover Beach,369000.00,3,2,1080,341.67,Regular 701 | 154455, Santa Maria-Orcutt,312900.00,3,2,1454,215.20,Regular 702 | 154461, Atascadero,575000.00,3,3,1961,293.22,Regular 703 | 154462, Santa Maria-Orcutt,26500.00,2,2,1344,19.72,Regular 704 | 154463, San Luis Obispo,2369000.00,5,6,4174,567.56,Regular 705 | 154464, Atascadero,67500.00,2,2,120,562.50,Regular 706 | 154466, San Luis Obispo,1490000.00,3,3,3201,465.48,Regular 707 | 154467, Morro Bay,652000.00,3,2,1427,456.90,Regular 708 | 154468, Atascadero,449000.00,3,3,2100,213.81,Regular 709 | 154469, Morro Bay,982800.00,3,2,2306,426.19,Regular 710 | 154470,Santa Maria-Orcutt,235000.00,4,3,2100,111.90,Short Sale 711 | 154472, Paso Robles,579900.00,4,3,3166,183.16,Regular 712 | 154474,Santa Maria-Orcutt,250000.00,3,2,1280,195.31,Short Sale 713 | 154475,Coalinga,100000.00,3,1,870,114.94,Short Sale 714 | 154476,Coalinga,125000.00,2,1,960,130.21,Short Sale 715 | 154477, Cambria,650000.00,2,2,919,707.29,Regular 716 | 154478,Santa Maria-Orcutt,119900.00,2,2,1034,115.96,Foreclosure 717 | 154479,San Miguel,209900.00,3,2,1356,154.79,Foreclosure 718 | 154481, Paso Robles,524900.00,3,2,2380,220.55,Regular 719 | 154482,Atascadero,349000.00,5,3,3000,116.33,Short Sale 720 | 154482, Atascadero,349000.00,5,3,3000,116.33,Regular 721 | 154483, Cambria,825000.00,2,3,1840,448.37,Regular 722 | 154484,Grover Beach,255000.00,3,2,1189,214.47,Short Sale 723 | 154485,Nipomo,259000.00,4,2,1336,193.86,Short Sale 724 | 154486,Paso Robles,199000.00,2,1,832,239.18,Short Sale 725 | 154487,Santa Maria-Orcutt,410000.00,5,3,2100,195.24,Foreclosure 726 | 154488, Paso Robles,199000.00,3,1,940,211.70,Regular 727 | 154489, Paso Robles,270000.00,3,2,1344,200.89,Regular 728 | 154490, Cayucos,695000.00,2,2,1437,483.65,Regular 729 | 154491, Cambria,2995000.00,5,4,3684,812.98,Regular 730 | 154492, Paso Robles,131900.00,1,2,300,439.67,Regular 731 | 154493, Cambria,995000.00,4,3,2717,366.21,Regular 732 | 154494, Santa Maria-Orcutt,250000.00,4,3,2097,119.22,Regular 733 | 154495,Arroyo Grande,239800.00,5,2,1575,152.25,Foreclosure 734 | 154496, Atascadero,425000.00,6,3,2628,161.72,Regular 735 | 154497, Arroyo Grande,525000.00,3,2,1750,300.00,Regular 736 | 154498, Pismo Beach,459900.00,3,2,1346,341.68,Regular 737 | 154501,Atascadero,229900.00,3,2,1041,220.85,Foreclosure 738 | 154503,Out Of Area,199900.00,3,2,1526,131.00,Regular 739 | 154504, Arroyo Grande,599000.00,4,2,1728,346.64,Regular 740 | 154506,Santa Maria-Orcutt,197600.00,4,2,1378,143.40,Foreclosure 741 | 154508, Santa Maria-Orcutt,355000.00,2,1,1145,310.04,Regular 742 | 154510, Paso Robles,339900.00,3,2,1325,256.53,Regular 743 | 154512, Santa Maria-Orcutt,299000.00,3,3,1850,161.62,Regular 744 | 154513,Soledad,166800.00,4,2,1765,94.50,Foreclosure 745 | 154515,Grover Beach,379000.00,4,2,1631,232.37,Short Sale 746 | 154516,Santa Ynez,1395000.00,4,4,2693,518.01,Short Sale 747 | 154517,Santa Maria-Orcutt,150000.00,3,2,1316,113.98,Short Sale 748 | 154518, San Luis Obispo,475000.00,3,2,1382,343.70,Regular 749 | 154519,Santa Maria-Orcutt,265000.00,4,3,2300,115.22,Foreclosure 750 | 154520,Atascadero,265000.00,3,2,1617,163.88,Short Sale 751 | 154521, Los Osos,225000.00,2,2,1150,195.65,Regular 752 | 154522,Paso Robles,249900.00,2,2,1674,149.28,Foreclosure 753 | 154523, Arroyo Grande,509000.00,3,2,1543,329.88,Regular 754 | 154525, Paso Robles,214900.00,2,2,1351,159.07,Regular 755 | 154526, Arroyo Grande,5499000.00,4,5,5060,1086.76,Regular 756 | 154528, Santa Maria-Orcutt,349900.00,3,2,2000,174.95,Regular 757 | 154530, Solvang,125000.00,2,2,1536,81.38,Regular 758 | 154531,Cambria,549000.00,2,2,924,594.16,Short Sale 759 | 154532, Cambria,865000.00,3,3,1860,465.05,Regular 760 | 154533, Bradley,1600000.00,3,3,2640,606.06,Regular 761 | 154534, Nipomo,1065000.00,4,4,3395,313.70,Regular 762 | 154536,Templeton,625000.00,3,2,1850,337.84,Foreclosure 763 | 154538, Santa Maria-Orcutt,249999.00,3,2,1000,250.00,Regular 764 | 154539, Arroyo Grande,975000.00,4,3,2720,358.46,Regular 765 | 154541,Oceano,204900.00,2,1,992,206.55,Short Sale 766 | 154546, Atascadero,355000.00,3,2,1737,204.38,Regular 767 | 154547,Out Of Area,134900.00,3,3,1435,94.01,Regular 768 | 154548,Santa Maria-Orcutt,199900.00,5,3,1671,119.63,Short Sale 769 | 154550,Santa Maria-Orcutt,349900.00,4,3,2800,124.96,Short Sale 770 | 154553,Santa Maria-Orcutt,99000.00,2,2,900,110.00,Foreclosure 771 | 154554,Coalinga,409000.00,4,3,2507,163.14,Short Sale 772 | 154556, Pismo Beach,339000.00,2,2,1440,235.42,Regular 773 | 154557, San Miguel,595000.00,3,3,2238,265.86,Regular 774 | 154558, Pismo Beach,849500.00,3,3,2725,311.74,Regular 775 | 154559, Paso Robles,399000.00,2,3,1772,225.17,Regular 776 | 154560, Paso Robles,399000.00,4,2,1947,204.93,Regular 777 | 154561, Solvang,525000.00,3,2,1720,305.23,Regular 778 | 154562, Paso Robles,319900.00,3,3,1605,199.31,Regular 779 | 154565, Paso Robles,495000.00,3,2,1877,263.72,Regular 780 | 154566,San Luis Obispo,372000.00,3,2,1104,336.96,Foreclosure 781 | 154575, Arroyo Grande,589000.00,3,2,1975,298.23,Regular 782 | 154580, Cambria,1100000.00,3,3,2392,459.87,Regular 783 | -------------------------------------------------------------------------------- /in/prime_nums.text: -------------------------------------------------------------------------------- 1 | 2 3 5 7 11 13 17 19 23 29 2 | 31 37 41 43 47 53 59 61 67 71 3 | 73 79 83 89 97 101 103 107 109 113 4 | 127 131 137 139 149 151 157 163 167 173 5 | 179 181 191 193 197 199 211 223 227 229 6 | 233 239 241 251 257 263 269 271 277 281 7 | 283 293 307 311 313 317 331 337 347 349 8 | 353 359 367 373 379 383 389 397 401 409 9 | 419 421 431 433 439 443 449 457 461 463 10 | 467 479 487 491 499 503 509 521 523 541 11 | -------------------------------------------------------------------------------- /in/uk-makerspaces-identifiable-data.csv: -------------------------------------------------------------------------------- 1 | Timestamp,Collected by,Name of makerspace,Email address,Postcode,Date your space opened (or plans to open),Date your space closed (if it is no longer running),cost to member/user per month,Sculpture,Do you have a materials shop?,Do you keep a list of members or regular users?,cluster type by size,Have you adopted a code of conduct?,Gender balance of members or regular users [Female],Gender balance of members or regular users [Male],Gender balance of members or regular users [Other],Gender balance of members or regular users [Prefer not to say],What ethnic groups are represented amongst your membership? [White],What ethnic groups are represented amongst your membership? [Mixed or multiple ethnic groups],What ethnic groups are represented amongst your membership? [Asian or Asian British],What ethnic groups are represented amongst your membership? [Other ethnic group],Total visits in November 2014,Unique users in November 2014,User types in November 2014 [Visitors or observers],User types in November 2014 [Hobbyist],User types in November 2014 [Startups],User types in November 2014 [Sole traders/Microbusinesses],User types in November 2014 [SMEs],User types in November 2014 [Students],User types in November 2014 [Teachers],User types in November 2014 [Other / don't know],Purpose of user visits in November 2014 [Introduction to making],Purpose of user visits in November 2014 [Make something specific],Purpose of user visits in November 2014 [Prototype],Purpose of user visits in November 2014 [Make one-off pieces],Purpose of user visits in November 2014 [Small batch production],Purpose of user visits in November 2014 [Socialise],Purpose of user visits in November 2014 [Other (detail below)],Do you produce accounts? 4-Jan-15,Makerspace. Edited by Researcher,Hub Workshop,info@hubworkshop.com,SE15 3SN,,,from 20 - 75,,,Yes,unknown,,Prefer not to say,Prefer not to say,Prefer not to say,Prefer not to say,Don't know,Don't know,Don't know,Don't know,n/a not open,n/a not open,,,,,,,,,,,,,,,, 5-Jan-15,Makerspace. Edited by Researcher,Nottingham Hackspace (Nottinghack),trustees@nottinghack.org.uk,NG3 1JH,,,?,Yes,No,Yes,large,Yes,10-19%,80-89%,<10%,,80-89%,<10%,<10%,<10%,,,,,,,,,,Don't know,,,,,,,, 5-Jan-15,Researcher,Farset Labs,info@farsetlabs.org.uk,BT12 5GH,1/4/12,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Jan-15,Makerspace,Medway Makers,tomdehavas@gmail.com,ME4 3JE,,,0,,No,Yes,small,No,20-29%,,,,,,,,,,,40-49%,20-29%,,20-29%,20-29%,,,20-29%,,,,,20-29%,, 8-Jan-15,Makerspace,fizzPop,fizzpop.makers@gmail .com,B5 5SR,18/07/2013,,Oct-40,,No,Yes,medium,No,10-19%,70-79%,,,70-79%,,,,,,,,,,,,,Don't know,,,,,,,Don't know,Yes 8-Jan-15,Makerspace. Edited by Researcher,South London Makerspace,trustees@southlondonmakerspace.org,SE24 9AA,28/02/2015,31/07/2014,20,,No,Yes,small,No,10-19%,80-89%,Don't know,Don't know,90-100%,<10%,<10%,<10%,100-250,0-10,10-19%,90-100%,< 10%,< 10%,< 10%,< 10%,< 10%,< 10%,,,,,,20-29%,90-100%,Yes 8-Jan-15,Researcher,Create Space London ,,HA9 6DE,,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Jan-15,Researcher,FounderHub,info@foundershub.co.uk,CF10 1DY,14/10/2014,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Jan-15,Researcher,LuneLab Makerspace,contactus@lunelab.org.uk, LA2 6ND,1/4/14,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 9-Jan-15,Makerspace,The Shed,cstheshed@kent.ac.uk,CT2 7NF,1/10/14,,1,,Yes,Yes,unknown,No,60-69%,40-49%,,,90-100%,,,,250-1000,250-1000,20-29%,,,,,70-79%,40-49%,,20-29%,,40-49%,40-49%,,40-49%,70-79%,Yes 11-Jan-15,Makerspace. Edited by Researcher,Build Brighton,info@buildbrighton.com,BN2 4AB,1/9/11,,5,,Yes,Yes,large,Yes,10-19%,80-89%,<10%,,80-89%,<10%,<10%,<10%,100-250,50-100,50-59%,50-59%,< 10%,< 10%,< 10%,30-39%,10-19%,< 10%,50-59%,20-29%,20-29%,30-39%,10-19%,30-39%,Don't know,Yes 13-Jan-15,Makerspace. Edited by Researcher,Makespace, info@makespace.org,CB2 1RX,1/3/13,,40,,Yes,Yes,large,Yes,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,,100-250,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,<10%,30-39%,30-39%,30-39%,<10%,20-29%,,Yes 15-Jan-15,Makerspace,Swansea Hackspace,info@swansea.hackspace.org.uk,SA1 1DP,23/06/2014,,10,,Yes,Yes,small,Yes,<10%,90-100%,,,90-100%,,,,0-10,10 to 50,< 10%,80-89%,,,,< 10%,,,,,,,,50-59%,,Yes 15-Jan-15,Makerspace. Edited by Researcher,57North (previously Hackerdeen) ,contact@57north.co,AB11 5BN,5/10/13,,20,,No,Yes,small,No,<10%,80-89%,10-19%,<10%,90-100%,,,,50-100,10 to 50,< 10%,80-89%,,,,< 10%,,< 10%,<10%,<10%,90-100%,,,90-100%,,Yes 15-Jan-15,Makerspace,BEC Fab Lab ,Becfablab@gmail.com,CA13 0HT,5/1/14,,,,Yes,Yes,small,Yes,50-59%,50-59%,,,90-100%,,,Don't know,50-100,50-100,10-19%,10-19%,10-19%,10-19%,10-19%,< 10%,< 10%,,10-19%,20-29%,10-19%,10-19%,<10%,Don't know,,Yes 15-Jan-15,Makerspace,Dundee MakerSpace,info@dundeemakerspace.co.uk ,DD1 4QB,1/9/14,,25-May,,Yes,Yes,small,Yes,10-19%,80-89%,,,90-100%,,,,10 to 50,10 to 50,10-19%,50-59%,,,,20-29%,,< 10%,10-19%,10-19%,10-19%,,,10-19%,,Yes 15-Jan-15,Makerspace. Edited by Researcher,EPIK,0208 0993608,CT3 4GP,1/1/13,,,,No,,large,Yes,20-29%,20-29%,60-69%,,80-89%,<10%,<10%,<10%,0-10,0-10,< 10%,< 10%,< 10%,< 10%,< 10%,< 10%,< 10%,< 10%,80-89%,,,,,80-89%,,Yes 15-Jan-15,Makerspace,Fab Lab Nerve Centre,e.durey@nervecentre.org,BT48 6HJ,7/1/12,,,,No,Yes,large,Yes,40-49%,60-69%,,,80-89%,<10%,<10%,,250-1000,,10-19%,40-49%,< 10%,< 10%,< 10%,20-29%,10-19%,20-29%,30-39%,50-59%,20-29%,,<10%,10-19%,,Yes 15-Jan-15,Makerspace. Edited by Researcher,fablab@strathclyde,fablab@strath.ac.uk,G1 1XJ,20/08/2013,,,,Yes,Yes,medium,Yes,,,,<10%,,,,,250-1000,10 to 50,< 10%,10-19%,,,,90-100%,< 10%,,90-100%,90-100%,20-29%,80-89%,10-19%,10-19%,,Yes 15-Jan-15,Makerspace. Edited by Researcher,MakerspaceFY1 (Blackpool Linux user group),admin@pcrecycler.co.uk,FY1 4DY,,,,,No,No,unknown,No,<10%,90-100%,,,,,,,10 to 50,10 to 50,,,,,,,,,,,,,,90-100%,,No 15-Jan-15,Makerspace,piel view hackers,info@octopuscollective.org,LA13 9BD,,,3-Aug,,No,,unknown,No,30-39%,70-79%,,,90-100%,,,,,,,,,,,,,,,,,,,,, 15-Jan-15,Researcher,Leicester Hackspace,info@leicesterhackspace.org.uk,LE1 1SB,1/3/14,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 15-Jan-15,Researcher,Potteries Hackspace,,ST5 2HN,1/8/14,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 16-Jan-15,Makerspace,Newport Makers Club,,NP20 1HG,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 16-Jan-15,Makerspace. Edited by Researcher,RARA Cooperative (redundant architects recreation association),rara.ale@gmail.com,E5 9ND,2/9/08,,150,,No,Yes,small,Yes,50-59%,40-49%,,,80-89%,10-19%,<10%,,,,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Yes 16-Jan-15,Makerspace. Edited by Researcher,Open Hub,openhubwrenna@gmail.com,DY1 3PD,3/11/15,,,,No,Yes,medium,No,70-79%,20-29%,,,30-39%,30-39%,<10%,<10%,,10 to 50,< 10%,,,,,,,,,,,,,,<10%,No 16-Jan-15,Makerspace,Lancaster And Morecambe Makers LAMM (lancaster maker lab),,LA1 4XQ,28/03/2015,,,,No,Yes,small,No,10-19%,70-79%,,<10%,90-100%,,,,0-10,0-10,,,,,,,,Don't know,,,,,,,,Yes 16-Jan-15,Makerspace. Edited by Researcher,Makernow,makernow@falmouth.ac.uk,TR10 9EZ,1/9/13,,,,Yes,Yes,medium,Yes,20-29%,60-69%,,,80-89%,<10%,<10%,<10%,10 to 50,10 to 50,,30-39%,< 10%,20-29%,,< 10%,< 10%,,40-49%,<10%,<10%,,,,,Yes 16-Jan-15,Makerspace. Edited by Researcher,Richmond MakerLabs,support@richmond.ml,TW10 7NY,17/09/2013,,,,No,No,small,No,<10%,,,,,,,,10 to 50,0-10,90-100%,90-100%,,,,,,,,,,<10%,<10%,<10%,<10%,No 19-Jan-15,Makerspace. Edited by Researcher,Camden Town Shed,mike@camdentownshed.org,NW1 9XZ,26/04/2011,,,,No,Yes,small,No,,90-100%,,,80-89%,,,,50-100,10 to 50,,90-100%,,,,,,,,,,80-89%,,<10%,,Yes 19-Jan-15,Makerspace,Blackhorse Workshop,info@blackhorseworkshop.co.uk,E17 6BX,1/2/14,,,,No,Yes,large,No,20-29%,80-89%,,,70-79%,<10%,10-19%,10-19%,50-100,10 to 50,< 10%,20-29%,10-19%,30-39%,10-19%,20-29%,< 10%,,20-29%,20-29%,20-29%,30-39%,20-29%,10-19%,,Yes 20-Jan-15,Makerspace. Edited by Researcher,FabLab Cardiff,hello@fablabcardiff.com,CF5 2YB,27/09/2014,,,Available in workshop in same building,Yes,Yes,small,Yes,20-29%,70-79%,,,80-89%,10-19%,,,50-100,10 to 50,70-79%,10-19%,< 10%,10-19%,< 10%,< 10%,,,20-29%,20-29%,40-49%,40-49%,30-39%,10-19%,,Yes 21-Jan-15,Makerspace. Edited by Researcher,Leigh Hackspace,info@leighhack.org,WN7 1DR,31/01/2015,,,,No,Yes,small,No,<10%,90-100%,,,90-100%,<10%,<10%,<10%,0-10,10 to 50,10-19%,< 10%,< 10%,< 10%,< 10%,< 10%,10-19%,< 10%,10-19%,50-59%,10-19%,50-59%,<10%,80-89%,,Yes 23-Jan-15,Makerspace,The Waiting Room,hello@st-botolphs.org,CO1 2PQ,17/08/2013,,,,No,Yes,medium,Yes,60-69%,30-39%,,,,,,,250-1000,100-250,,30-39%,,30-39%,,30-39%,,,10-19%,20-29%,,<10%,,60-69%,,No 26-Jan-15,Makerspace,MadLab (manchester),office@madlab.org.uk,M4 1HN,1/7/09,,,,Yes,Yes,large,No,30-39%,50-59%,,,70-79%,<10%,<10%,,5000+,1000-5000,20-29%,20-29%,20-29%,< 10%,10-19%,10-19%,< 10%,,80-89%,<10%,,,,50-59%,,Yes 27-Jan-15,Makerspace,DoES Liverpool,hello@doesliverpool.com,L1 4LN,,,,,Yes,Yes,medium,Yes,10-19%,80-89%,,,80-89%,<10%,<10%,<10%,100-250,50-100,,,,,,,,,,,,,,,,Yes 27-Jan-15,Makerspace,Manchester FabLab,info@fablabmanchester.org,M4 6BU,1/4/11,,,,Yes,Yes,large,Yes,40-49%,60-69%,,,70-79%,<10%,20-29%,,250-1000,250-1000,,60-69%,< 10%,< 10%,< 10%,20-29%,10-19%,,,30-39%,10-19%,10-19%,<10%,<10%,,Yes 28-Jan-15,Makerspace. Edited by Researcher,resource,info@resource-hwu.org,TD1 3HF,1/4/14,,,,No,Yes,small,No,90-100%,<10%,,,Don't know,,,,50-100,,,< 10%,< 10%,70-79%,,< 10%,,,,60-69%,,,20-29%,,,No 30-Jan-15,Makerspace. Edited by Researcher,So Make It ,join@somakeit.org.uk,SO15 3FQ,1/3/13,,20-May,,No,Yes,medium,Yes,10-19%,80-89%,<10%,<10%,80-89%,<10%,<10%,<10%,100-250,10 to 50,10-19%,80-89%,< 10%,< 10%,< 10%,< 10%,< 10%,< 10%,<10%,30-39%,<10%,10-19%,<10%,40-49%,<10%,Yes 30-Jan-15,Researcher,Access space,,S1 4RG,1/8/10,,,,Yes,,unknown,Yes,,,,,,,,,,,,,,,,,,,,,,,,,, 1-Feb-15,Makerspace,Cheltenham Hackspace,hello@cheltenhamhackspace.org,GL51 7SD,,,0,,No,Yes,small,No,10-19%,90-100%,,,90-100%,,,,50-100,10 to 50,< 10%,80-89%,,,,10-19%,,,,50-59%,50-59%,,,90-100%,,Yes 2-Feb-15,Makerspace. Edited by Researcher,Multi-Skills Workshop,multi-skills@btconnect.com,BN26 6JF,1/5/12,,8 per hour,,Yes,Yes,medium,No,40-49%,60-69%,,,80-89%,,,,100-250,50-100,,70-79%,,< 10%,,20-29%,,,,20-29%,<10%,<10%,<10%,<10%,,Yes 2-Feb-15,Makerspace,Hitchin Hackspace,info@hackhitchin.org.uk,SG5 1RB,5/3/12,,10,,No,Yes,small,No,<10%,90-100%,,,90-100%,<10%,<10%,<10%,250-1000,10 to 50,< 10%,80-89%,10-19%,10-19%,< 10%,10-19%,10-19%,10-19%,70-79%,70-79%,60-69%,30-39%,<10%,40-49%,,No 3-Feb-15,Makerspace. Edited by Researcher,Eagle House Pop-Up Furniture Factory,justin.ricks@kwmc.org.uk,BS4 1NL,1/11/14,,0,,No,Yes,small,No,50-59%,50-59%,,,80-89%,20-29%,,,100-250,10 to 50,80-89%,,10-19%,,,,,,,,,,,,,Yes 3-Feb-15,Makerspace,Coventry Makerspace,coventrymakerspace@gmail.com,CV1 3JQ,,,,,No,Yes,unknown,Yes,,,,,,,,,,,,,,,,,,,,,,,,,,Yes 4-Feb-15,Makerspace. Edited by Researcher,MakeSpace at the Institute of Making,hello@instituteofmaking.org.uk,WC1E 7JE,16/12/2012,,0,,No,Yes,large,Yes,40-49%,50-59%,,,,,,,5000+,,30-39%,< 10%,< 10%,,,30-39%,20-29%,,40-49%,,30-39%,20-29%,,10-19%,,Yes 4-Feb-15,Makerspace,FabLabDevon,hello@fablabdevon.org,EX4 3PQ,22/05/2014,,,,Yes,Yes,unknown,Yes,,,,,,,,,100-250,10 to 50,,,,,,,,,,,,,,,,No 6-Feb-15,Makerspace,Building Bloqs,info@buildingbloqs.com,N18 3QT,1/5/13,,40,,Yes,Yes,medium,No,10-19%,80-89%,,,80-89%,10-19%,<10%,,50-100,,,< 10%,10-19%,70-79%,,10-19%,< 10%,,20-29%,90-100%,<10%,90-100%,10-19%,60-69%,30-39%,Yes 6-Feb-15,Makerspace. Edited by Researcher,Machines Room,machinesroom@limewharf.org,E2 9DQ,1/7/14,,5 - 200,can use cnc machines or 3D printers for creation of 3D models (though cnc's are 3-axis which can prove difficult in recreating a truly 3D object),Yes,Yes,large,Yes,50-59%,50-59%,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,250-1000,10 to 50,10-19%,50-59%,< 10%,20-29%,< 10%,40-49%,< 10%,Don't know,30-39%,20-29%,30-39%,30-39%,20-29%,20-29%,30-39%, 6-Feb-15,Makerspace,Maker Club,hello@makerclub.org,BN1 41J,30/03/2015,,,,No,Yes,small,Yes,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,0-10,0-10,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Yes 6-Feb-15,Makerspace. Edited by Researcher,MakersCAFE,hello@makerscafe.com,E2 8AA,20/08/2014,,,,Yes,Yes,unknown,No,Don't know,Don't know,,,Don't know,Don't know,Don't know,,100-250,50-100,80-89%,,50-59%,70-79%,,80-89%,,,70-79%,80-89%,80-89%,80-89%,80-89%,80-89%,,Yes 7-Feb-15,Makerspace. Edited by Researcher,London Hackspace,contact@london.hackspace.org.uk,E2 9DY,2/11/09,,5,Stoneworking Easel,Yes,Yes,large,Yes,20-29%,60-69%,Don't know,Don't know,50-59%,10-19%,10-19%,10-19%,5000+,250-1000,10-19%,30-39%,20-29%,10-19%,,20-29%,,10-19%,30-39%,60-69%,60-69%,50-59%,30-39%,50-59%,,Yes 8-Feb-15,Makerspace. Edited by Researcher,Derby Makers,chair@derbymakers.com,DE1 3AF,1/11/13,,4,,No,Yes,small,No,30-39%,60-69%,,,,,,,,,,,,,,,,,,,,,,,,Yes 9-Feb-15,Makerspace,Duke Studios,HELLO@DUKE-STUDIOS.COM,LS9 8AG,1/5/11,,,,No,Yes,medium,Yes,40-49%,50-59%,,,Don't know,Don't know,Don't know,Don't know,,,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,Yes 10-Feb-15,Makerspace. Edited by Researcher,API - Arloesi Pontio Innovation,w.griffith@bangor.ac.uk,LL57 1UT,1/3/15,,,,No,Yes,unknown,Yes,,,,,,,,,0-10,0-10,,,,,,,,,,,,,,,,Yes 11-Feb-15,Makerspace,The Goodlife Centre Ltd,alison@thegoodlifecentre.co.uk,SE1 0QL,10/4/10,,,,No,No,unknown,No,,,,,,,,,,,,,,,,,,,90-100%,,,,,,,Yes 11-Feb-15,Makerspace,Tiree Tech Wave,alan@hcibook.com,PA77 6UR,15/03/2011,,,,No,Yes,medium,No,20-29%,80-89%,,,90-100%,<10%,,,0-10,10 to 50,30-39%,10-19%,10-19%,10-19%,< 10%,50-59%,30-39%,,20-29%,20-29%,30-39%,30-39%,<10%,90-100%,50-59%,No 12-Feb-15,Makerspace,Hatch,info@3space.org,OX1 2HF,1/1/15,,,,No,Yes,small,Yes,30-39%,50-59%,,,80-89%,,10-19%,,0-10,0-10,,,50-59%,,,10-19%,,40-49%,,,,,,,,Yes 12-Feb-15,Makerspace,Creative Reuse Centre March,admin@ccorrn.org.uk,PE15 8QP,15/05/2015,,,,Yes,Yes,unknown,Yes,,,,<10%,,,,,,,,,,,,,,,,,,,,,,Yes 13-Feb-15,Makerspace,London Sculpture Workshop,info@londonsculptureworkshop.org,SE1 5SF,1/9/12,,,Variety of tools as detailed previously.,No,Yes,large,No,50-59%,40-49%,,,,90-100%,,,250-1000,100-250,40-49%,50-59%,Don't know,Don't know,Don't know,40-49%,30-39%,20-29%,70-79%,90-100%,80-89%,80-89%,30-39%,<10%,,Yes 13-Feb-15,Makerspace,RLab - Reading Hackspace,matt+rlab@daubers.co.uk,RG1 7BX,12/12/13,,,Chisels,Yes,Yes,medium,Yes,<10%,90-100%,Don't know,Don't know,Don't know,Don't know,Don't know,Don't know,100-250,10 to 50,< 10%,60-69%,< 10%,< 10%,< 10%,20-29%,10-19%,,<10%,50-59%,<10%,<10%,<10%,10-19%,<10%,Yes 13-Feb-15,Makerspace. Edited by Researcher,Creative Work Spaces,Fiona.tarn@carillionservices.co.uk,UB5 5AS,,,20-May,,,,unknown,Yes,,,,,,,,,,,,,,,,,,,,,,,,,, 14-Feb-15,Makerspace,York Hackspace,makers@york.hackspace.org.uk,YO23 1AB,16/09/2011,,,,No,No,small,No,10-19%,80-89%,,,90-100%,,,,0-10,0-10,< 10%,90-100%,< 10%,,,< 10%,,,<10%,,,<10%,,90-100%,,No 15-Feb-15,Makerspace,Bristol Hackspace,info@bristol.hackspace.org.uk,BS3 4EA,1/11/09,,20-Oct,,No,Yes,medium,No,<10%,90-100%,<10%,Don't know,80-89%,<10%,<10%,<10%,50-100,10 to 50,< 10%,80-89%,< 10%,Don't know,Don't know,10-19%,Don't know,10-19%,30-39%,30-39%,Don't know,Don't know,<10%,50-59%,Don't know,Yes 16-Feb-15,Makerspace,Maker Space,http://www.makerspace.org.uk/contact/,NE1 8AW,5/5/12,,,,No,Yes,unknown,No,10-19%,80-89%,,,80-89%,<10%,<10%,<10%,100-250,50-100,50-59%,50-59%,,,,,,,60-69%,60-69%,,,,60-69%,,No 17-Feb-15,Makerspace,Fab Lab London,hello@fablablondon.org,EC2R 8AE,19/09/2014,,36,,Yes,Yes,large,Yes,40-49%,40-49%,,,40-49%,,20-29%,<10%,250-1000,100-250,10-19%,,20-29%,20-29%,,,10-19%,,,10-19%,10-19%,<10%,<10%,10-19%,,Yes 17-Feb-15,Makerspace,Swindon Hackspace,,SN1 1QN,1/7/10,,,,No,Yes,small,No,10-19%,80-89%,<10%,<10%,90-100%,,,,50-100,10 to 50,20-29%,80-89%,,,,< 10%,< 10%,,20-29%,70-79%,70-79%,20-29%,<10%,50-59%,,No 18-Feb-15,Makerspace,FabLab NorthEast / Sunderland,,SR1 3QJ,1/5/15,,,,,Yes,unknown,Yes,,,,,,,,,,,,,,,,,,,,,,,,,, 18-Feb-15,Makerspace,Leeds Hackspace,directors@leedshackspace.org.uk,LS9 7DS,4/5/12,,25,,No,Yes,medium,No,<10%,90-100%,Don't know,Don't know,90-100%,<10%,<10%,Don't know,10 to 50,10 to 50,90-100%,90-100%,< 10%,< 10%,< 10%,50-59%,20-29%,Don't know,30-39%,40-49%,30-39%,50-59%,10-19%,80-89%,Don't know,No 19-Feb-15,Makerspace. Edited by Researcher,Make:Bromyard,info@makebromyard.org.uk,HR7 4DU,19/02/2015,,20,,No,Yes,small,No,30-39%,60-69%,,,90-100%,,,,0-10,0-10,,,,,,,,Don't know,,,,,,,Don't know,Yes 19-Feb-15,Makerspace. Edited by Researcher,Lincoln Hackspace,Lincolnhackspae@live.co.uk,LN6 3RU,31/03/2015,30/11/2013,20,,No,Yes,small,Yes,10-19%,80-89%,,,80-89%,,<10%,,10 to 50,0-10,,80-89%,< 10%,< 10%,,< 10%,,,,50-59%,10-19%,,,90-100%,,No 25-Feb-15,Makerspace. Edited by Researcher,Makerversity,christina@makerversity.org,WC2R 1LA,11/9/13,,,,No,Yes,large,No,,,,,,,,,100-250,10 to 50,,,,,,,,,,,,,,,,Yes 25-Feb-15,Makerspace,Eastbourne Shed,oscarplumley@ageconcerneastbourne.co.uk,BN22 7SP,26/03/2015,,,Wood Carving equipment,Yes,Yes,unknown,Yes,<10%,90-100%,,,90-100%,,,,,,,,,,,,,,,,,,,,,No 26-Feb-15,Makerspace. Edited by Researcher,The Old School Club,info@theoldschoolclub.co.uk,SW11 5QL,10/6/13,,,,Yes,Yes,small,No,90-100%,,,,80-89%,,,,10 to 50,10 to 50,,50-59%,,,,50-59%,,,10-19%,20-29%,,,,50-59%,,Yes 27-Feb-15,Makerspace,Remakery,people@remakery.org,SE5 9HY,6/1/14,,Oct-98,,Yes,Yes,large,Yes,50-59%,50-59%,Don't know,Don't know,50-59%,<10%,<10%,<10%,100-250,50-100,10-19%,20-29%,10-19%,40-49%,< 10%,< 10%,< 10%,< 10%,10-19%,40-49%,10-19%,20-29%,10-19%,40-49%,,Yes 28-Feb-15,Researcher,Men in Sheds MK,info@meninshedsmk.og.uk,MK11 3HB,,,12,,,,small,,,,,,,,,,,,,,,,,,,,,,,,,,, 28-Feb-15,Researcher,Fab Lab Liverpool,,L3 5YD,,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 28-Feb-15,Researcher,Create Labs Scotland,reception@stepstirling.co.uk,FK7 7RP,,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 28-Feb-15,Researcher,Surrey & Hampshire Hackspace,,GU14 7SS,,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Makerspace,GIMPS (Gadlys Inventors Makers & Promulgation Society ),,CF44 8AD,21/10/2014,,,,No,Yes,small,No,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Makerspace. Edited by Researcher,Make Aberdeen,info@make-aberdeen.com,AB10 1JR,,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Edinburgh Hacklab, info@edinburghhacklab.com, EH9 1PL,,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Ellesmere Port Fab lab, info@fablabep.org,CH65 8AB,18/07/2013,,,,Yes,Yes,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Fab Lab Airedale,Enquiries@fablabairedale.org,BD21 4HQ,1/2/12,,,,Yes,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Fab Lab Plymouth,fablab@pca.ac.uk,PL4 8AT,9/12/14,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Electron Club,,G2 3JD,29/07/2006,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,hackspace cardiff,hackspace.cardiff@gmail.com,CF5 4AR,27/08/2014,,,,,Yes,small,,<10%,90-100%,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Hackspace Manchester Hack Man,,M4 1HN,1/7/10,,,,No,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,MakLab,hello@maklab.co.uk,G3 6UJ,9/6/11,,,,,,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,Sheffield Hardware Hackers and Makers,admins@sheffieldhardwarehackers.org.uk,S2 4SJ,20/02/2015,,,,,Yes,unknown,,,,,,,,,,,,,,,,,,,,,,,,,,, 8-Mar-15,Researcher,T-Exchange/Moray Maker Space,,IV36 3YR ,1/1/12,,,,No,Yes,medium,,,,,,,,,,,,,,,,,,,,,,,,,,, 9-Mar-15,Makerspace,Fablab Belfast,patrick.ohare@ashtoncentre.com,BT15 2BP,9/4/12,,,none,Yes,Yes,large,Yes,40-49%,40-49%,10-19%,<10%,80-89%,,<10%,<10%,50-100,50-100,< 10%,50-59%,20-29%,< 10%,< 10%,70-79%,30-39%,,80-89%,80-89%,70-79%,80-89%,20-29%,<10%,,Yes 10-Mar-15,Makerspace. Edited by Researcher,Imperial College Advanced Hackspace,icah@imperial.ac.uk,SW7 2AZ,5/5/14,,,,No,Yes,large,Yes,20-29%,70-79%,,,40-49%,20-29%,10-19%,20-29%,100-250,50-100,,,,,,70-79%,20-29%,< 10%,50-59%,80-89%,80-89%,40-49%,40-49%,20-29%,,Yes 16-Mar-15,Makerspace,Oxhack,,OX1 1NJ,11/7/13,,10,None particularly for this use.,No,Yes,medium,No,<10%,90-100%,,,90-100%,<10%,<10%,<10%,100-250,10 to 50,10-19%,80-89%,10-19%,10-19%,< 10%,< 10%,< 10%,< 10%,10-19%,10-19%,<10%,10-19%,<10%,80-89%,<10%,Yes -------------------------------------------------------------------------------- /in/uppercase.text: -------------------------------------------------------------------------------- 1 | The history of New York begins around 10,000 BC, when the first Native Americans arrived. By 1100 AD, New York's main native cultures, the Iroquoian and Algonquian, had developed. European discovery of New York was led by the French in 1524 and the first land claim came in 1609 by the Dutch. As part of New Netherland, the colony was important in the fur trade and eventually became an agricultural resource thanks to the patroon system. In 1626 the Dutch bought the island of Manhattan from Native Americans.[1] In 1664, England renamed the colony New York, after the Duke of York (later James II & VII.) New York City gained prominence in the 18th century as a major trading port in the Thirteen Colonies. 2 | 3 | New York played a pivotal role during the American Revolution and subsequent war. The Stamp Act Congress in 1765 brought together representatives from across the Thirteen Colonies to form a unified response to British policies. The Sons of Liberty were active in New York City to challenge British authority. After a major loss at the Battle of Long Island, the Continental Army suffered a series of additional defeats that forced a retreat from the New York City area, leaving the strategic port and harbor to the British army and navy as their North American base of operations for the rest of the war. The Battle of Saratoga was the turning point of the war in favor of the Americans, convincing France to formally ally with them. New York's constitution was adopted in 1777, and strongly influenced the United States Constitution. New York City was the national capital at various times between 1785 and 1790, where the Bill of Rights was drafted. Albany became the permanent state capital in 1797. In 1787, New York became the eleventh state to ratify the United States Constitution. 4 | 5 | New York hosted significant transportation advancements in the 19th century, including the first steamboat line in 1807, the Erie Canal in 1825, and America's first regularly scheduled rail service in 1831. These advancements led to the expanded settlement of western New York and trade ties to the Midwest settlements around the Great Lakes. 6 | 7 | Due to New York City's trade ties to the South, there were numerous southern sympathizers in the early days of the American Civil War and the mayor proposed secession. Far from any of the battles, New York ultimately sent the most men and money to support the Union cause. Thereafter, the state helped create the industrial age and consequently was home to some of the first labor unions. 8 | 9 | During the 19th century, New York City became the main entry point for European immigrants to the United States, beginning with a wave of Irish during their Great Famine. Millions came through Castle Clinton in Battery Park before Ellis Island opened in 1892 to welcome millions more, increasingly from eastern and southern Europe. The Statue of Liberty opened in 1886 and became a symbol of hope. New York boomed during the Roaring Twenties, before the Wall Street Crash of 1929, and skyscrapers expressed the energy of the city. New York City was the site of successive tallest buildings in the world from 1913–74. 10 | 11 | The buildup of defense industries for World War II turned around the state's economy from the Great Depression, as hundreds of thousands worked to defeat the Axis powers. Following the war, the state experienced significant suburbanization around all the major cities, and most central cities shrank. The Thruway system opened in 1956, signalling another era of transportation advances. 12 | 13 | Following a period of near–bankruptcy in the late 1970s, New York City renewed its stature as a cultural center, attracted more immigration, and hosted the development of new music styles. The city developed from publishing to become a media capital over the second half of the 20th century, hosting most national news channels and broadcasts. Some of its newspapers became nationally and globallyrenowned. The state's manufacturing base eroded with the restructuring of industry, and the state transitioned into service industries. 14 | 15 | The September 11 attacks of 2001 destroyed the World Trade Center, killing almost 3,000 people; they were the largest terrorist attacks on United States soil. -------------------------------------------------------------------------------- /in/word_count.text: -------------------------------------------------------------------------------- 1 | The history of New York begins around 10,000 BC, when the first Native Americans arrived. By 1100 AD, New York's main native cultures, the Iroquoian and Algonquian, had developed. European discovery of New York was led by the French in 1524 and the first land claim came in 1609 by the Dutch. As part of New Netherland, the colony was important in the fur trade and eventually became an agricultural resource thanks to the patroon system. In 1626 the Dutch bought the island of Manhattan from Native Americans.[1] In 1664, England renamed the colony New York, after the Duke of York (later James II & VII.) New York City gained prominence in the 18th century as a major trading port in the Thirteen Colonies. 2 | 3 | New York played a pivotal role during the American Revolution and subsequent war. The Stamp Act Congress in 1765 brought together representatives from across the Thirteen Colonies to form a unified response to British policies. The Sons of Liberty were active in New York City to challenge British authority. After a major loss at the Battle of Long Island, the Continental Army suffered a series of additional defeats that forced a retreat from the New York City area, leaving the strategic port and harbor to the British army and navy as their North American base of operations for the rest of the war. The Battle of Saratoga was the turning point of the war in favor of the Americans, convincing France to formally ally with them. New York's constitution was adopted in 1777, and strongly influenced the United States Constitution. New York City was the national capital at various times between 1785 and 1790, where the Bill of Rights was drafted. Albany became the permanent state capital in 1797. In 1787, New York became the eleventh state to ratify the United States Constitution. 4 | 5 | New York hosted significant transportation advancements in the 19th century, including the first steamboat line in 1807, the Erie Canal in 1825, and America's first regularly scheduled rail service in 1831. These advancements led to the expanded settlement of western New York and trade ties to the Midwest settlements around the Great Lakes. 6 | 7 | Due to New York City's trade ties to the South, there were numerous southern sympathizers in the early days of the American Civil War and the mayor proposed secession. Far from any of the battles, New York ultimately sent the most men and money to support the Union cause. Thereafter, the state helped create the industrial age and consequently was home to some of the first labor unions. 8 | 9 | During the 19th century, New York City became the main entry point for European immigrants to the United States, beginning with a wave of Irish during their Great Famine. Millions came through Castle Clinton in Battery Park before Ellis Island opened in 1892 to welcome millions more, increasingly from eastern and southern Europe. The Statue of Liberty opened in 1886 and became a symbol of hope. New York boomed during the Roaring Twenties, before the Wall Street Crash of 1929, and skyscrapers expressed the energy of the city. New York City was the site of successive tallest buildings in the world from 1913–74. 10 | 11 | The buildup of defense industries for World War II turned around the state's economy from the Great Depression, as hundreds of thousands worked to defeat the Axis powers. Following the war, the state experienced significant suburbanization around all the major cities, and most central cities shrank. The Thruway system opened in 1956, signalling another era of transportation advances. 12 | 13 | Following a period of near–bankruptcy in the late 1970s, New York City renewed its stature as a cultural center, attracted more immigration, and hosted the development of new music styles. The city developed from publishing to become a media capital over the second half of the 20th century, hosting most national news channels and broadcasts. Some of its newspapers became nationally and globallyrenowned. The state's manufacturing base eroded with the restructuring of industry, and the state transitioned into service industries. 14 | 15 | The September 11 attacks of 2001 destroyed the World Trade Center, killing almost 3,000 people; they were the largest terrorist attacks on United States soil. -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/advanced/accumulator/StackOverFlowSurvey.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.advanced.accumulator 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object StackOverFlowSurvey { 8 | 9 | def main(args: Array[String]) { 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("StackOverFlowSurvey").setMaster("local[1]") 12 | val sparkContext = new SparkContext(conf) 13 | 14 | val total = sparkContext.longAccumulator 15 | val missingSalaryMidPoint = sparkContext.longAccumulator 16 | 17 | val responseRDD = sparkContext.textFile("in/2016-stack-overflow-survey-responses.csv") 18 | 19 | val responseFromCanada = responseRDD.filter(response => { 20 | val splits = response.split(Utils.COMMA_DELIMITER, -1) 21 | total.add(1) 22 | 23 | if (splits(14).isEmpty) { 24 | missingSalaryMidPoint.add(1) 25 | } 26 | 27 | splits(2) == "Canada" 28 | }) 29 | 30 | println("Count of responses from Canada: " + responseFromCanada.count()) 31 | println("Total count of responses: " + total.value) 32 | println("Count of responses missing salary middle point: " + missingSalaryMidPoint.value) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/advanced/accumulator/StackOverFlowSurveyFollowUp.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.advanced.accumulator 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object StackOverFlowSurveyFollowUp { 8 | 9 | def main(args: Array[String]) { 10 | 11 | Logger.getLogger("org").setLevel(Level.ERROR) 12 | val conf = new SparkConf().setAppName("StackOverFlowSurvey").setMaster("local[1]") 13 | val sparkContext = new SparkContext(conf) 14 | 15 | val total = sparkContext.longAccumulator 16 | val missingSalaryMidPoint = sparkContext.longAccumulator 17 | val processedBytes = sparkContext.longAccumulator 18 | 19 | val responseRDD = sparkContext.textFile("in/2016-stack-overflow-survey-responses.csv") 20 | 21 | val responseFromCanada = responseRDD.filter(response => { 22 | 23 | processedBytes.add(response.getBytes().length) 24 | val splits = response.split(Utils.COMMA_DELIMITER, -1) 25 | total.add(1) 26 | 27 | if (splits(14).isEmpty) { 28 | missingSalaryMidPoint.add(1) 29 | } 30 | splits(2) == "Canada" 31 | 32 | }) 33 | 34 | println("Count of responses from Canada: " + responseFromCanada.count()) 35 | println("Number of bytes processed: " + processedBytes.value) 36 | println("Total count of responses: " + total.value) 37 | println("Count of responses missing salary middle point: " + missingSalaryMidPoint.value) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/advanced/broadcast/UkMakerSpaces.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.advanced.broadcast 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | import scala.io.Source 8 | 9 | object UkMakerSpaces { 10 | 11 | def main(args: Array[String]) { 12 | Logger.getLogger("org").setLevel(Level.ERROR) 13 | val conf = new SparkConf().setAppName("UkMakerSpaces").setMaster("local[1]") 14 | val sparkContext = new SparkContext(conf) 15 | 16 | val postCodeMap = sparkContext.broadcast(loadPostCodeMap()) 17 | 18 | val makerSpaceRdd = sparkContext.textFile("in/uk-makerspaces-identifiable-data.csv") 19 | 20 | val regions = makerSpaceRdd 21 | .filter(line => line.split(Utils.COMMA_DELIMITER, -1)(0) != "Timestamp") 22 | .filter(line => getPostPrefix(line).isDefined) 23 | .map(line => postCodeMap.value.getOrElse(getPostPrefix(line).get, "Unknown")) 24 | 25 | for ((region, count) <- regions.countByValue()) println(region + " : " + count) 26 | } 27 | 28 | def getPostPrefix(line: String): Option[String] = { 29 | val splits = line.split(Utils.COMMA_DELIMITER, -1) 30 | val postcode = splits(4) 31 | if (postcode.isEmpty) None else Some(postcode.split(" ")(0)) 32 | } 33 | 34 | def loadPostCodeMap(): Map[String, String] = { 35 | Source.fromFile("in/uk-postcode.csv").getLines.map(line => { 36 | val splits = line.split(Utils.COMMA_DELIMITER, -1) 37 | splits(0) -> splits(7) 38 | }).toMap 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/advanced/broadcast/UkMakerSpacesWithoutBroadcast.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.advanced.broadcast 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | import scala.io.Source 8 | 9 | object UkMakerSpacesWithoutBroadcast { 10 | 11 | def main(args: Array[String]) { 12 | Logger.getLogger("org").setLevel(Level.ERROR) 13 | val conf = new SparkConf().setAppName("UkMakerSpaces").setMaster("local[1]") 14 | val sparkContext = new SparkContext(conf) 15 | val postCodeMap = loadPostCodeMap() 16 | val makerSpaceRdd = sparkContext.textFile("in/uk-makerspaces-identifiable-data.csv") 17 | 18 | val regions = makerSpaceRdd 19 | .filter(line => line.split(Utils.COMMA_DELIMITER, -1)(0) != "Timestamp") 20 | .map(line => { 21 | getPostPrefixes(line).filter(prefix => postCodeMap.contains(prefix)) 22 | .map(prefix => postCodeMap(prefix)) 23 | .headOption.getOrElse("Unknow") 24 | }) 25 | for ((region, count) <- regions.countByValue()) println(region + " : " + count) 26 | } 27 | 28 | def getPostPrefixes(line: String): List[String] = { 29 | val postcode = line.split(Utils.COMMA_DELIMITER, -1)(4) 30 | val cleanedPostCode = postcode.replaceAll("\\s+", "") 31 | (1 to cleanedPostCode.length).map(i => cleanedPostCode.substring(0, i)).toList 32 | } 33 | 34 | def loadPostCodeMap(): Map[String, String] = { 35 | Source.fromFile("in/uk-postcode.csv").getLines.map(line => { 36 | val splits = line.split(Utils.COMMA_DELIMITER, -1) 37 | splits(0) -> splits(7) 38 | }).toMap 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/commons/Utils.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.commons 2 | 3 | object Utils { 4 | // a regular expression which matches commas but not commas within double quotations 5 | val COMMA_DELIMITER = ",(?=([^\"]*\"[^\"]*\")*[^\"]*$)" 6 | } 7 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/aggregation/combinebykey/AverageHousePriceSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.aggregation.combinebykey 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AverageHousePriceSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("wordCounts").setMaster("local[3]") 12 | val sc = new SparkContext(conf) 13 | 14 | val lines = sc.textFile("in/RealEstate.csv") 15 | val cleanedLines = lines.filter(line => !line.contains("Bedrooms")) 16 | 17 | val housePricePairRdd = cleanedLines.map(line => (line.split(",")(3), line.split(",")(2).toDouble)) 18 | 19 | val createCombiner = (x: Double) => (1, x) 20 | val mergeValue = (avgCount: AvgCount, x: Double) => (avgCount._1 + 1, avgCount._2 + x) 21 | val mergeCombiners = (avgCountA: AvgCount, avgCountB: AvgCount) => (avgCountA._1 + avgCountB._1, avgCountA._2 + avgCountB._2) 22 | 23 | val housePriceTotal = housePricePairRdd.combineByKey(createCombiner, mergeValue, mergeCombiners) 24 | 25 | val housePriceAvg = housePriceTotal.mapValues(avgCount => avgCount._2 / avgCount._1) 26 | for ((bedrooms, avgPrice) <- housePriceAvg.collect()) println(bedrooms + " : " + avgPrice) 27 | } 28 | 29 | type AvgCount = (Int, Double) 30 | } 31 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/aggregation/reducebykey/WordCount.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.aggregation.reducebykey 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object WordCount { 7 | 8 | def main(args: Array[String]) { 9 | Logger.getLogger("org").setLevel(Level.ERROR) 10 | val conf = new SparkConf().setAppName("wordCounts").setMaster("local[3]") 11 | val sc = new SparkContext(conf) 12 | 13 | val lines = sc.textFile("in/word_count.text") 14 | val wordRdd = lines.flatMap(line => line.split(" ")) 15 | val wordPairRdd = wordRdd.map(word => (word, 1)) 16 | 17 | val wordCounts = wordPairRdd.reduceByKey((x, y) => x + y) 18 | for ((word, count) <- wordCounts.collect()) println(word + " : " + count) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/aggregation/reducebykey/housePrice/AverageHousePriceProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.aggregation.reducebykey.housePrice 2 | 3 | object AverageHousePriceProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* Create a Spark program to read the house data from in/RealEstate.csv, 8 | output the average price for houses with different number of bedrooms. 9 | 10 | The houses dataset contains a collection of recent real estate listings in San Luis Obispo county and 11 | around it.  12 | 13 | The dataset contains the following fields: 14 | 1. MLS: Multiple listing service number for the house (unique ID). 15 | 2. Location: city/town where the house is located. Most locations are in San Luis Obispo county and 16 | northern Santa Barbara county (Santa Maria­Orcutt, Lompoc, Guadelupe, Los Alamos), but there 17 | some out of area locations as well. 18 | 3. Price: the most recent listing price of the house (in dollars). 19 | 4. Bedrooms: number of bedrooms. 20 | 5. Bathrooms: number of bathrooms. 21 | 6. Size: size of the house in square feet. 22 | 7. Price/SQ.ft: price of the house per square foot. 23 | 8. Status: type of sale. Thee types are represented in the dataset: Short Sale, Foreclosure and Regular. 24 | 25 | Each field is comma separated. 26 | 27 | Sample output: 28 | 29 | (3, 325000) 30 | (1, 266356) 31 | (2, 325000) 32 | ... 33 | 34 | 3, 1 and 2 mean the number of bedrooms. 325000 means the average price of houses with 3 bedrooms is 325000. 35 | */ 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/aggregation/reducebykey/housePrice/AverageHousePriceSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.aggregation.reducebykey.housePrice 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AverageHousePriceSolution { 7 | 8 | def main(args: Array[String]) { 9 | Logger.getLogger("org").setLevel(Level.ERROR) 10 | val conf = new SparkConf().setAppName("avgHousePrice").setMaster("local[3]") 11 | val sc = new SparkContext(conf) 12 | 13 | val lines = sc.textFile("in/RealEstate.csv") 14 | val cleanedLines = lines.filter(line => !line.contains("Bedrooms")) 15 | 16 | val housePricePairRdd = cleanedLines.map(line => (line.split(",")(3), (1, line.split(",")(2).toDouble))) 17 | 18 | val housePriceTotal = housePricePairRdd.reduceByKey((x, y) => (x._1 + y._1, x._2 + y._2)) 19 | 20 | println("housePriceTotal: ") 21 | for ((bedroom, total) <- housePriceTotal.collect()) println(bedroom + " : " + total) 22 | 23 | val housePriceAvg = housePriceTotal.mapValues(avgCount => avgCount._2 / avgCount._1) 24 | println("housePriceAvg: ") 25 | for ((bedroom, avg) <- housePriceAvg.collect()) println(bedroom + " : " + avg) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/aggregation/reducebykey/housePrice/AvgCount.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.aggregation.reducebykey.housePrice 2 | 3 | case class AvgCount(count: Int, total: Double) 4 | 5 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/create/PairRddFromRegularRdd.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.create 2 | 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | object PairRddFromRegularRdd { 6 | 7 | def main(args: Array[String]) { 8 | 9 | val conf = new SparkConf().setAppName("create").setMaster("local[1]") 10 | val sc = new SparkContext(conf) 11 | 12 | val inputStrings = List("Lily 23", "Jack 29", "Mary 29", "James 8") 13 | val regularRDDs = sc.parallelize(inputStrings) 14 | 15 | val pairRDD = regularRDDs.map(s => (s.split(" ")(0), s.split(" ")(1))) 16 | pairRDD.coalesce(1).saveAsTextFile("out/pair_rdd_from_regular_rdd") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/create/PairRddFromTupleList.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.create 2 | 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | object PairRddFromTupleList { 6 | 7 | def main(args: Array[String]) { 8 | 9 | val conf = new SparkConf().setAppName("create").setMaster("local[1]") 10 | val sc = new SparkContext(conf) 11 | 12 | val tuple = List(("Lily", 23), ("Jack", 29), ("Mary", 29), ("James", 8)) 13 | val pairRDD = sc.parallelize(tuple) 14 | 15 | pairRDD.coalesce(1).saveAsTextFile("out/pair_rdd_from_tuple_list") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/filter/AirportsNotInUsaProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.filter 2 | 3 | object AirportsNotInUsaProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* Create a Spark program to read the airport data from in/airports.text; 8 | generate a pair RDD with airport name being the key and country name being the value. 9 | Then remove all the airports which are located in United States and output the pair RDD to out/airports_not_in_usa_pair_rdd.text 10 | 11 | Each row of the input file contains the following columns: 12 | Airport ID, Name of airport, Main city served by airport, Country where airport is located, 13 | IATA/FAA code, ICAO Code, Latitude, Longitude, Altitude, Timezone, DST, Timezone in Olson format 14 | 15 | Sample output: 16 | 17 | ("Kamloops", "Canada") 18 | ("Wewak Intl", "Papua New Guinea") 19 | ... 20 | */ 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/filter/AirportsNotInUsaSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.filter 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AirportsNotInUsaSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | val conf = new SparkConf().setAppName("airports").setMaster("local") 11 | val sc = new SparkContext(conf) 12 | 13 | val airportsRDD = sc.textFile("in/airports.text") 14 | 15 | val airportPairRDD = airportsRDD.map(line => (line.split(Utils.COMMA_DELIMITER)(1), 16 | line.split(Utils.COMMA_DELIMITER)(3))) 17 | val airportsNotInUSA = airportPairRDD.filter(keyValue => keyValue._2 != "\"United States\"") 18 | 19 | airportsNotInUSA.saveAsTextFile("out/airports_not_in_usa_pair_rdd.text") 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/groupbykey/AirportsByCountryProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.groupbykey 2 | 3 | object AirportsByCountryProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* Create a Spark program to read the airport data from in/airports.text, 8 | output the the list of the names of the airports located in each country. 9 | 10 | Each row of the input file contains the following columns: 11 | Airport ID, Name of airport, Main city served by airport, Country where airport is located, IATA/FAA code, 12 | ICAO Code, Latitude, Longitude, Altitude, Timezone, DST, Timezone in Olson format 13 | 14 | Sample output: 15 | 16 | "Canada", List("Bagotville", "Montreal", "Coronation", ...) 17 | "Norway" : List("Vigra", "Andenes", "Alta", "Bomoen", "Bronnoy",..) 18 | "Papua New Guinea", List("Goroka", "Madang", ...) 19 | ... 20 | */ 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/groupbykey/AirportsByCountrySolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.groupbykey 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object AirportsByCountrySolution { 8 | 9 | def main(args: Array[String]) { 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("airports").setMaster("local[*]") 12 | val sc = new SparkContext(conf) 13 | 14 | val lines = sc.textFile("in/airports.text") 15 | 16 | val countryAndAirportNameAndPair = lines.map(airport => (airport.split(Utils.COMMA_DELIMITER)(3), 17 | airport.split(Utils.COMMA_DELIMITER)(1))) 18 | 19 | val airportsByCountry = countryAndAirportNameAndPair.groupByKey() 20 | 21 | for ((country, airportName) <- airportsByCountry.collectAsMap()) println(country + ": " + airportName.toList) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/groupbykey/GroupByKeyVsReduceByKey.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.groupbykey 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object GroupByKeyVsReduceByKey { 7 | 8 | def main(args: Array[String]) { 9 | Logger.getLogger("org").setLevel(Level.ERROR) 10 | val conf = new SparkConf().setAppName("GroupByKeyVsReduceByKey").setMaster("local[*]") 11 | val sc = new SparkContext(conf) 12 | 13 | val words = List("one", "two", "two", "three", "three", "three") 14 | val wordsPairRdd = sc.parallelize(words).map(word => (word, 1)) 15 | 16 | val wordCountsWithReduceByKey = wordsPairRdd.reduceByKey((x, y) => x + y).collect() 17 | println("wordCountsWithReduceByKey: " + wordCountsWithReduceByKey.toList) 18 | 19 | val wordCountsWithGroupByKey = wordsPairRdd.groupByKey().mapValues(intIterable => intIterable.size).collect() 20 | println("wordCountsWithGroupByKey: " + wordCountsWithGroupByKey.toList) 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/join/JoinOperations.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.join 2 | 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | object JoinOperations { 6 | 7 | def main(args: Array[String]) { 8 | 9 | val conf = new SparkConf().setAppName("JoinOperations").setMaster("local[1]") 10 | val sc = new SparkContext(conf) 11 | 12 | val ages = sc.parallelize(List(("Tom", 29),("John", 22))) 13 | val addresses = sc.parallelize(List(("James", "USA"), ("John", "UK"))) 14 | 15 | val join = ages.join(addresses) 16 | join.saveAsTextFile("out/age_address_join.text") 17 | 18 | val leftOuterJoin = ages.leftOuterJoin(addresses) 19 | leftOuterJoin.saveAsTextFile("out/age_address_left_out_join.text") 20 | 21 | val rightOuterJoin = ages.rightOuterJoin(addresses) 22 | rightOuterJoin.saveAsTextFile("out/age_address_right_out_join.text") 23 | 24 | val fullOuterJoin = ages.fullOuterJoin(addresses) 25 | fullOuterJoin.saveAsTextFile("out/age_address_full_out_join.text") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/mapValues/AirportsUppercaseProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.mapValues 2 | 3 | object AirportsUppercaseProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* Create a Spark program to read the airport data from in/airports.text, generate a pair RDD with airport name 8 | being the key and country name being the value. Then convert the country name to uppercase and 9 | output the pair RDD to out/airports_uppercase.text 10 | 11 | Each row of the input file contains the following columns: 12 | 13 | Airport ID, Name of airport, Main city served by airport, Country where airport is located, IATA/FAA code, 14 | ICAO Code, Latitude, Longitude, Altitude, Timezone, DST, Timezone in Olson format 15 | 16 | Sample output: 17 | 18 | ("Kamloops", "CANADA") 19 | ("Wewak Intl", "PAPUA NEW GUINEA") 20 | ... 21 | */ 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/mapValues/AirportsUppercaseSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.mapValues 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AirportsUppercaseSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | val conf = new SparkConf().setAppName("airports").setMaster("local") 11 | val sc = new SparkContext(conf) 12 | 13 | val airportsRDD = sc.textFile("in/airports.text") 14 | 15 | val airportPairRDD = airportsRDD.map((line: String) => (line.split(Utils.COMMA_DELIMITER)(1), 16 | line.split(Utils.COMMA_DELIMITER)(3))) 17 | 18 | val upperCase = airportPairRDD.mapValues(countryName => countryName.toUpperCase) 19 | 20 | upperCase.saveAsTextFile("out/airports_uppercase.text") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/sort/AnotherSortedWordCountSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.sort 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AnotherSortedWordCountSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("wordCounts").setMaster("local[3]") 12 | val sc = new SparkContext(conf) 13 | 14 | val lines = sc.textFile("in/word_count.text") 15 | val wordRdd = lines.flatMap(line => line.split(" ")) 16 | 17 | val wordPairRdd = wordRdd.map(word => (word, 1)) 18 | val wordCounts = wordPairRdd.reduceByKey((x, y) => x + y) 19 | 20 | val sortedWordCounts = wordCounts.sortBy(wordCount => wordCount._2, ascending = false) 21 | 22 | for ((word, count) <- sortedWordCounts.collect()) println(word + " : " + count) 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/sort/AverageHousePriceSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.sort 2 | 3 | import com.sparkTutorial.pairRdd.aggregation.reducebykey.housePrice.AvgCount 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object AverageHousePriceSolution { 8 | 9 | def main(args: Array[String]) { 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("averageHousePriceSolution").setMaster("local[3]") 12 | val sc = new SparkContext(conf) 13 | 14 | val lines = sc.textFile("in/RealEstate.csv") 15 | val cleanedLines = lines.filter(line => !line.contains("Bedrooms")) 16 | val housePricePairRdd = cleanedLines.map( 17 | line => (line.split(",")(3).toInt, AvgCount(1, line.split(",")(2).toDouble))) 18 | 19 | val housePriceTotal = housePricePairRdd.reduceByKey((x, y) => AvgCount(x.count + y.count, x.total + y.total)) 20 | 21 | val housePriceAvg = housePriceTotal.mapValues(avgCount => avgCount.total / avgCount.count) 22 | 23 | val sortedHousePriceAvg = housePriceAvg.sortByKey() 24 | 25 | for ((bedrooms, avgPrice) <- sortedHousePriceAvg.collect()) println(bedrooms + " : " + avgPrice) 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/sort/SortedWordCountProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.sort 2 | 3 | 4 | object SortedWordCountProblem { 5 | 6 | /* Create a Spark program to read the an article from in/word_count.text, 7 | output the number of occurrence of each word in descending order. 8 | 9 | Sample output: 10 | 11 | apple : 200 12 | shoes : 193 13 | bag : 176 14 | ... 15 | */ 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/pairRdd/sort/SortedWordCountSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.pairRdd.sort 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object SortedWordCountSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("wordCounts").setMaster("local[3]") 12 | val sc = new SparkContext(conf) 13 | 14 | val lines = sc.textFile("in/word_count.text") 15 | val wordRdd = lines.flatMap(line => line.split(" ")) 16 | 17 | val wordPairRdd = wordRdd.map(word => (word, 1)) 18 | val wordToCountPairs = wordPairRdd.reduceByKey((x, y) => x + y) 19 | 20 | val countToWordParis = wordToCountPairs.map(wordToCount => (wordToCount._2, wordToCount._1)) 21 | 22 | val sortedCountToWordParis = countToWordParis.sortByKey(ascending = false) 23 | 24 | val sortedWordToCountPairs = sortedCountToWordParis.map(countToWord => (countToWord._2, countToWord._1)) 25 | 26 | for ((word, count) <- sortedWordToCountPairs.collect()) println(word + " : " + count) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/WordCount.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd 2 | 3 | import org.apache.log4j.Level 4 | import org.apache.log4j.Logger 5 | import org.apache.spark.SparkConf 6 | import org.apache.spark._ 7 | 8 | object WordCount { 9 | 10 | def main(args: Array[String]) { 11 | 12 | Logger.getLogger("org").setLevel(Level.ERROR) 13 | val conf = new SparkConf().setAppName("wordCounts").setMaster("local[3]") 14 | val sc = new SparkContext(conf) 15 | 16 | val lines = sc.textFile("in/word_count.text") 17 | val words = lines.flatMap(line => line.split(" ")) 18 | 19 | val wordCounts = words.countByValue() 20 | for ((word, count) <- wordCounts) println(word + " : " + count) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/airports/AirportsByLatitudeProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.airports 2 | 3 | object AirportsByLatitudeProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* Create a Spark program to read the airport data from in/airports.text, find all the airports whose latitude are bigger than 40. 8 | Then output the airport's name and the airport's latitude to out/airports_by_latitude.text. 9 | 10 | Each row of the input file contains the following columns: 11 | Airport ID, Name of airport, Main city served by airport, Country where airport is located, IATA/FAA code, 12 | ICAO Code, Latitude, Longitude, Altitude, Timezone, DST, Timezone in Olson format 13 | 14 | Sample output: 15 | "St Anthony", 51.391944 16 | "Tofino", 49.082222 17 | ... 18 | */ 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/airports/AirportsByLatitudeSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.airports 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AirportsByLatitudeSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | val conf = new SparkConf().setAppName("airports").setMaster("local[2]") 11 | val sc = new SparkContext(conf) 12 | 13 | val airports = sc.textFile("in/airports.text") 14 | val airportsInUSA = airports.filter(line => line.split(Utils.COMMA_DELIMITER)(6).toFloat > 40) 15 | 16 | val airportsNameAndCityNames = airportsInUSA.map(line => { 17 | val splits = line.split(Utils.COMMA_DELIMITER) 18 | splits(1) + ", " + splits(6) 19 | }) 20 | 21 | airportsNameAndCityNames.saveAsTextFile("out/airports_by_latitude.text") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/airports/AirportsInUsaProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.airports 2 | 3 | object AirportsInUsaProblem { 4 | def main(args: Array[String]) { 5 | 6 | /* Create a Spark program to read the airport data from in/airports.text, find all the airports which are located in United States 7 | and output the airport's name and the city's name to out/airports_in_usa.text. 8 | 9 | Each row of the input file contains the following columns: 10 | Airport ID, Name of airport, Main city served by airport, Country where airport is located, IATA/FAA code, 11 | ICAO Code, Latitude, Longitude, Altitude, Timezone, DST, Timezone in Olson format 12 | 13 | Sample output: 14 | "Putnam County Airport", "Greencastle" 15 | "Dowagiac Municipal Airport", "Dowagiac" 16 | ... 17 | */ 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/airports/AirportsInUsaSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.airports 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object AirportsInUsaSolution { 7 | 8 | def main(args: Array[String]) { 9 | 10 | val conf = new SparkConf().setAppName("airports").setMaster("local[2]") 11 | val sc = new SparkContext(conf) 12 | 13 | val airports = sc.textFile("in/airports.text") 14 | val airportsInUSA = airports.filter(line => line.split(Utils.COMMA_DELIMITER)(3) == "\"United States\"") 15 | 16 | val airportsNameAndCityNames = airportsInUSA.map(line => { 17 | val splits = line.split(Utils.COMMA_DELIMITER) 18 | splits(1) + ", " + splits(2) 19 | }) 20 | airportsNameAndCityNames.saveAsTextFile("out/airports_in_usa.text") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/collect/CollectExample.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.collect 2 | 3 | import org.apache.log4j.Level 4 | import org.apache.log4j.Logger 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object CollectExample { 8 | def main(args: Array[String]) { 9 | Logger.getLogger("org").setLevel(Level.ERROR) 10 | val conf = new SparkConf().setAppName("collect").setMaster("local[*]") 11 | val sc = new SparkContext(conf) 12 | 13 | val inputWords = List("spark", "hadoop", "spark", "hive", "pig", "cassandra", "hadoop") 14 | val wordRdd = sc.parallelize(inputWords) 15 | 16 | val words = wordRdd.collect() 17 | 18 | for (word <- words) println(word) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/count/CountExample.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.count 2 | 3 | import org.apache.log4j.Level 4 | import org.apache.log4j.Logger 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object CountExample { 8 | 9 | def main(args: Array[String]) { 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("count").setMaster("local[*]") 12 | val sc = new SparkContext(conf) 13 | 14 | val inputWords = List("spark", "hadoop", "spark", "hive", "pig", "cassandra", "hadoop") 15 | val wordRdd = sc.parallelize(inputWords) 16 | println("Count: " + wordRdd.count()) 17 | 18 | val wordCountByValue = wordRdd.countByValue() 19 | println("CountByValue:") 20 | 21 | for ((word, count) <- wordCountByValue) println(word + " : " + count) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/nasaApacheWebLogs/SameHostsProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.nasaApacheWebLogs 2 | 3 | object SameHostsProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* "in/nasa_19950701.tsv" file contains 10000 log lines from one of NASA's apache server for July 1st, 1995. 8 | "in/nasa_19950801.tsv" file contains 10000 log lines for August 1st, 1995 9 | Create a Spark program to generate a new RDD which contains the hosts which are accessed on BOTH days. 10 | Save the resulting RDD to "out/nasa_logs_same_hosts.csv" file. 11 | 12 | Example output: 13 | vagrant.vf.mmc.com 14 | www-a1.proxy.aol.com 15 | ..... 16 | 17 | Keep in mind, that the original log files contains the following header lines. 18 | host logname time method url response bytes 19 | 20 | Make sure the head lines are removed in the resulting RDD. 21 | */ 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/nasaApacheWebLogs/SameHostsSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.nasaApacheWebLogs 2 | 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | object SameHostsSolution { 6 | 7 | def main(args: Array[String]) { 8 | 9 | val conf = new SparkConf().setAppName("sameHosts").setMaster("local[1]") 10 | val sc = new SparkContext(conf) 11 | 12 | val julyFirstLogs = sc.textFile("in/nasa_19950701.tsv") 13 | val augustFirstLogs = sc.textFile("in/nasa_19950801.tsv") 14 | 15 | val julyFirstHosts = julyFirstLogs.map(line => line.split("\t")(0)) 16 | val augustFirstHosts = augustFirstLogs.map(line => line.split("\t")(0)) 17 | 18 | val intersection = julyFirstHosts.intersection(augustFirstHosts) 19 | 20 | val cleanedHostIntersection = intersection.filter(host => host != "host") 21 | cleanedHostIntersection.saveAsTextFile("out/nasa_logs_same_hosts.csv") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/nasaApacheWebLogs/UnionLogProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.nasaApacheWebLogs 2 | 3 | object UnionLogProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* "in/nasa_19950701.tsv" file contains 10000 log lines from one of NASA's apache server for July 1st, 1995. 8 | "in/nasa_19950801.tsv" file contains 10000 log lines for August 1st, 1995 9 | Create a Spark program to generate a new RDD which contains the log lines from both July 1st and August 1st, 10 | take a 0.1 sample of those log lines and save it to "out/sample_nasa_logs.tsv" file. 11 | 12 | Keep in mind, that the original log files contains the following header lines. 13 | host logname time method url response bytes 14 | 15 | Make sure the head lines are removed in the resulting RDD. 16 | */ 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/nasaApacheWebLogs/UnionLogsSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.nasaApacheWebLogs 2 | 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | object UnionLogsSolution { 6 | 7 | def main(args: Array[String]) { 8 | 9 | val conf = new SparkConf().setAppName("unionLogs").setMaster("local[*]") 10 | 11 | val sc = new SparkContext(conf) 12 | 13 | val julyFirstLogs = sc.textFile("in/nasa_19950701.tsv") 14 | val augustFirstLogs = sc.textFile("in/nasa_19950801.tsv") 15 | 16 | val aggregatedLogLines = julyFirstLogs.union(augustFirstLogs) 17 | 18 | val cleanLogLines = aggregatedLogLines.filter(line => isNotHeader(line)) 19 | 20 | val sample = cleanLogLines.sample(withReplacement = true, fraction = 0.1) 21 | 22 | sample.saveAsTextFile("out/sample_nasa_logs.csv") 23 | } 24 | 25 | def isNotHeader(line: String): Boolean = !(line.startsWith("host") && line.contains("bytes")) 26 | } 27 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/persist/PersistExample.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.persist 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | import org.apache.spark.storage.StorageLevel 6 | 7 | object PersistExample { 8 | 9 | def main(args: Array[String]) { 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | val conf = new SparkConf().setAppName("reduce").setMaster("local[*]") 12 | val sc = new SparkContext(conf) 13 | 14 | val inputIntegers = List(1, 2, 3, 4, 5) 15 | val integerRdd = sc.parallelize(inputIntegers) 16 | 17 | integerRdd.persist(StorageLevel.MEMORY_ONLY) 18 | 19 | integerRdd.reduce((x, y) => x * y) 20 | integerRdd.count() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/reduce/ReduceExample.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.reduce 2 | import org.apache.log4j.{Level, Logger} 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | object ReduceExample { 6 | 7 | def main(args: Array[String]) { 8 | Logger.getLogger("org").setLevel(Level.OFF) 9 | val conf = new SparkConf().setAppName("reduce").setMaster("local[*]") 10 | val sc = new SparkContext(conf) 11 | 12 | val inputIntegers = List(1, 2, 3, 4, 5) 13 | val integerRdd = sc.parallelize(inputIntegers) 14 | 15 | val product = integerRdd.reduce((x, y) => x * y) 16 | println("product is :" + product) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/sumOfNumbers/SumOfNumbersProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.sumOfNumbers 2 | 3 | object SumOfNumbersProblem { 4 | 5 | def main(args: Array[String]) { 6 | 7 | /* Create a Spark program to read the first 100 prime numbers from in/prime_nums.text, 8 | print the sum of those numbers to console. 9 | 10 | Each row of the input file contains 10 prime numbers separated by spaces. 11 | */ 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/sumOfNumbers/SumOfNumbersSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.sumOfNumbers 2 | 3 | import org.apache.log4j.Level 4 | import org.apache.log4j.Logger 5 | import org.apache.spark.{SparkConf, SparkContext} 6 | 7 | object SumOfNumbersSolution { 8 | 9 | def main(args: Array[String]) { 10 | Logger.getLogger("org").setLevel(Level.OFF) 11 | 12 | val conf = new SparkConf().setAppName("primeNumbers").setMaster("local[*]") 13 | val sc = new SparkContext(conf) 14 | 15 | val lines = sc.textFile("in/prime_nums.text") 16 | 17 | val numbers = lines.flatMap(line => line.split("\\s+")) 18 | 19 | val validNumbers = numbers.filter(number => !number.isEmpty) 20 | 21 | val intNumbers = validNumbers.map(number => number.toInt) 22 | 23 | println("Sum is: " + intNumbers.reduce((x, y) => x + y)) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/rdd/take/TakeExample.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.rdd.take 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.{SparkConf, SparkContext} 5 | 6 | object TakeExample { 7 | 8 | def main(args: Array[String]) { 9 | Logger.getLogger("org").setLevel(Level.OFF) 10 | val conf = new SparkConf().setAppName("take").setMaster("local[*]") 11 | val sc = new SparkContext(conf) 12 | 13 | val inputWords = List("spark", "hadoop", "spark", "hive", "pig", "cassandra", "hadoop") 14 | val wordRdd = sc.parallelize(inputWords) 15 | 16 | val words = wordRdd.take(3) 17 | for (word <- words) println(word) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/HousePriceProblem.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql 2 | 3 | 4 | object HousePriceProblem { 5 | 6 | /* Create a Spark program to read the house data from in/RealEstate.csv, 7 | group by location, aggregate the average price per SQ Ft and sort by average price per SQ Ft. 8 | 9 | The houses dataset contains a collection of recent real estate listings in San Luis Obispo county and 10 | around it.  11 | 12 | The dataset contains the following fields: 13 | 1. MLS: Multiple listing service number for the house (unique ID). 14 | 2. Location: city/town where the house is located. Most locations are in San Luis Obispo county and 15 | northern Santa Barbara county (Santa Maria­Orcutt, Lompoc, Guadelupe, Los Alamos), but there 16 | some out of area locations as well. 17 | 3. Price: the most recent listing price of the house (in dollars). 18 | 4. Bedrooms: number of bedrooms. 19 | 5. Bathrooms: number of bathrooms. 20 | 6. Size: size of the house in square feet. 21 | 7. Price/SQ.ft: price of the house per square foot. 22 | 8. Status: type of sale. Thee types are represented in the dataset: Short Sale, Foreclosure and Regular. 23 | 24 | Each field is comma separated. 25 | 26 | Sample output: 27 | 28 | +----------------+-----------------+ 29 | | Location| avg(Price SQ Ft)| 30 | +----------------+-----------------+ 31 | | Oceano| 95.0| 32 | | Bradley| 206.0| 33 | | San Luis Obispo| 359.0| 34 | | Santa Ynez| 491.4| 35 | | Cayucos| 887.0| 36 | |................|.................| 37 | |................|.................| 38 | |................|.................| 39 | */ 40 | } 41 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/HousePriceSolution.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.sql.SparkSession 5 | 6 | object HousePriceSolution { 7 | 8 | val PRICE_SQ_FT = "Price SQ Ft" 9 | 10 | def main(args: Array[String]) { 11 | 12 | Logger.getLogger("org").setLevel(Level.ERROR) 13 | val session = SparkSession.builder().appName("HousePriceSolution").master("local[1]").getOrCreate() 14 | 15 | val realEstate = session.read 16 | .option("header", "true") 17 | .option("inferSchema", value = true) 18 | .csv("in/RealEstate.csv") 19 | 20 | realEstate.groupBy("Location") 21 | .avg(PRICE_SQ_FT) 22 | .orderBy("avg(Price SQ Ft)") 23 | .show() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/RddDatasetConversion.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql 2 | 3 | import com.sparkTutorial.commons.Utils 4 | import org.apache.log4j.{Level, Logger} 5 | import org.apache.spark.sql.SparkSession 6 | import org.apache.spark.{SparkConf, SparkContext} 7 | 8 | object RddDatasetConversion { 9 | 10 | def main(args: Array[String]) { 11 | Logger.getLogger("org").setLevel(Level.ERROR) 12 | val conf = new SparkConf().setAppName("StackOverFlowSurvey").setMaster("local[1]") 13 | 14 | val sc = new SparkContext(conf) 15 | 16 | val session = SparkSession.builder().appName("StackOverFlowSurvey").master("local[1]").getOrCreate() 17 | 18 | val lines = sc.textFile("in/2016-stack-overflow-survey-responses.csv") 19 | 20 | val responseRDD = lines 21 | .filter(line => !line.split(Utils.COMMA_DELIMITER, -1)(2).equals("country")) 22 | .map(line => { 23 | val splits = line.split(Utils.COMMA_DELIMITER, -1) 24 | Response(splits(2), toInt(splits(6)), splits(9), toInt(splits(14))) 25 | }) 26 | 27 | import session.implicits._ 28 | val responseDataset = responseRDD.toDS() 29 | 30 | System.out.println("=== Print out schema ===") 31 | responseDataset.printSchema() 32 | 33 | System.out.println("=== Print 20 records of responses table ===") 34 | responseDataset.show(20) 35 | 36 | for (response <- responseDataset.rdd.collect()) println(response) 37 | } 38 | 39 | def toInt(split: String): Option[Double] = { 40 | if (split.isEmpty) None else Some(split.toDouble) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/Response.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql 2 | 3 | case class Response(country: String, age_midpoint: Option[Double], occupation: String, salary_midpoint: Option[Double]) 4 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/StackOverFlowSurvey.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.sql.SparkSession 5 | 6 | object StackOverFlowSurvey { 7 | 8 | val AGE_MIDPOINT = "age_midpoint" 9 | val SALARY_MIDPOINT = "salary_midpoint" 10 | val SALARY_MIDPOINT_BUCKET = "salary_midpoint_bucket" 11 | 12 | def main(args: Array[String]) { 13 | 14 | Logger.getLogger("org").setLevel(Level.ERROR) 15 | val session = SparkSession.builder().appName("StackOverFlowSurvey").master("local[1]").getOrCreate() 16 | 17 | val dataFrameReader = session.read 18 | 19 | val responses = dataFrameReader 20 | .option("header", "true") 21 | .option("inferSchema", value = true) 22 | .csv("in/2016-stack-overflow-survey-responses.csv") 23 | 24 | System.out.println("=== Print out schema ===") 25 | responses.printSchema() 26 | 27 | val responseWithSelectedColumns = responses.select("country", "occupation", AGE_MIDPOINT, SALARY_MIDPOINT) 28 | 29 | System.out.println("=== Print the selected columns of the table ===") 30 | responseWithSelectedColumns.show() 31 | 32 | System.out.println("=== Print records where the response is from Afghanistan ===") 33 | responseWithSelectedColumns.filter(responseWithSelectedColumns.col("country").===("Afghanistan")).show() 34 | 35 | System.out.println("=== Print the count of occupations ===") 36 | val groupedDataset = responseWithSelectedColumns.groupBy("occupation") 37 | groupedDataset.count().show() 38 | 39 | System.out.println("=== Print records with average mid age less than 20 ===") 40 | responseWithSelectedColumns.filter(responseWithSelectedColumns.col(AGE_MIDPOINT) < 20).show() 41 | 42 | System.out.println("=== Print the result by salary middle point in descending order ===") 43 | responseWithSelectedColumns.orderBy(responseWithSelectedColumns.col(SALARY_MIDPOINT).desc).show() 44 | 45 | System.out.println("=== Group by country and aggregate by average salary middle point ===") 46 | val datasetGroupByCountry = responseWithSelectedColumns.groupBy("country") 47 | datasetGroupByCountry.avg(SALARY_MIDPOINT).show() 48 | 49 | val responseWithSalaryBucket = responses.withColumn(SALARY_MIDPOINT_BUCKET, 50 | responses.col(SALARY_MIDPOINT).divide(20000).cast("integer").multiply(20000)) 51 | 52 | System.out.println("=== With salary bucket column ===") 53 | responseWithSalaryBucket.select(SALARY_MIDPOINT, SALARY_MIDPOINT_BUCKET).show() 54 | 55 | System.out.println("=== Group by salary bucket ===") 56 | responseWithSalaryBucket.groupBy(SALARY_MIDPOINT_BUCKET).count().orderBy(SALARY_MIDPOINT_BUCKET).show() 57 | 58 | session.stop() 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/TypedDataset.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.sql.SparkSession 5 | 6 | object TypedDataset { 7 | 8 | val AGE_MIDPOINT = "age_midpoint" 9 | val SALARY_MIDPOINT = "salary_midpoint" 10 | val SALARY_MIDPOINT_BUCKET = "salaryMidpointBucket" 11 | 12 | def main(args: Array[String]) { 13 | Logger.getLogger("org").setLevel(Level.ERROR) 14 | val session = SparkSession.builder().appName("StackOverFlowSurvey").master("local[*]").getOrCreate() 15 | val dataFrameReader = session.read 16 | 17 | val responses = dataFrameReader 18 | .option("header", "true") 19 | .option("inferSchema", value = true) 20 | .csv("in/2016-stack-overflow-survey-responses.csv") 21 | 22 | val responseWithSelectedColumns = responses.select("country", "age_midpoint", "occupation", "salary_midpoint") 23 | 24 | import session.implicits._ 25 | val typedDataset = responseWithSelectedColumns.as[Response] 26 | 27 | System.out.println("=== Print out schema ===") 28 | typedDataset.printSchema() 29 | 30 | System.out.println("=== Print 20 records of responses table ===") 31 | typedDataset.show(20) 32 | 33 | System.out.println("=== Print the responses from Afghanistan ===") 34 | typedDataset.filter(response => response.country == "Afghanistan").show() 35 | 36 | System.out.println("=== Print the count of occupations ===") 37 | typedDataset.groupBy(typedDataset.col("occupation")).count().show() 38 | 39 | System.out.println("=== Print responses with average mid age less than 20 ===") 40 | typedDataset.filter(response => response.age_midpoint.isDefined && response.age_midpoint.get < 20.0).show() 41 | 42 | System.out.println("=== Print the result by salary middle point in descending order ===") 43 | typedDataset.orderBy(typedDataset.col(SALARY_MIDPOINT).desc).show() 44 | 45 | System.out.println("=== Group by country and aggregate by average salary middle point ===") 46 | typedDataset.filter(response => response.salary_midpoint.isDefined).groupBy("country").avg(SALARY_MIDPOINT).show() 47 | 48 | System.out.println("=== Group by salary bucket ===") 49 | typedDataset.map(response => response.salary_midpoint.map(point => Math.round(point / 20000) * 20000).orElse(None)) 50 | .withColumnRenamed("value", SALARY_MIDPOINT_BUCKET) 51 | .groupBy(SALARY_MIDPOINT_BUCKET) 52 | .count() 53 | .orderBy(SALARY_MIDPOINT_BUCKET).show() 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/scala/com/sparkTutorial/sparkSql/join/UkMakerSpaces.scala: -------------------------------------------------------------------------------- 1 | package com.sparkTutorial.sparkSql.join 2 | 3 | import org.apache.log4j.{Level, Logger} 4 | import org.apache.spark.sql.{SparkSession, functions} 5 | 6 | object UkMakerSpaces { 7 | 8 | def main(args: Array[String]) { 9 | 10 | Logger.getLogger("org").setLevel(Level.ERROR) 11 | 12 | val session = SparkSession.builder().appName("UkMakerSpaces").master("local[*]").getOrCreate() 13 | 14 | val makerSpace = session.read.option("header", "true").csv("in/uk-makerspaces-identifiable-data.csv") 15 | 16 | val postCode = session.read.option("header", "true").csv("in/uk-postcode.csv") 17 | .withColumn("PostCode", functions.concat_ws("", functions.col("PostCode"), functions.lit(" "))) 18 | 19 | System.out.println("=== Print 20 records of makerspace table ===") 20 | makerSpace.select("Name of makerspace", "Postcode").show() 21 | 22 | System.out.println("=== Print 20 records of postcode table ===") 23 | postCode.show() 24 | 25 | val joined = makerSpace.join(postCode, makerSpace.col("Postcode").startsWith(postCode.col("Postcode")), "left_outer") 26 | 27 | System.out.println("=== Group by Region ===") 28 | joined.groupBy("Region").count().show(200) 29 | } 30 | } 31 | --------------------------------------------------------------------------------