This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.util._ | |
def vectorizedAddUnsafe128x3(a: Array[Byte], b: Array[Byte]): Array[Byte] = { | |
var carry: Int = 0 | |
((a.length -1) to 0 by -4).map(i => { | |
val x: Long = | |
java.lang.Integer.toUnsignedLong(((((((a(i - 3)) << 24) | a(i - 2)) << 16) | a(i - 1)) << 8) | a(i)) + | |
java.lang.Integer.toUnsignedLong(((((((b(i - 3)) << 24) | b(i - 2)) << 16) | b(i - 1)) << 8) | b(i)) + | |
carry | |
carry = if (x > 0xFFFFFFFFL && (i - 3) % 16 != 0) 1 else 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################## | |
# Constants # | |
################################################## | |
TABLE_NAME="underlying_tables" | |
DB_COL="db_name" | |
VIEW_COL="view_name" | |
TABLE_COL="table_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################## | |
# Constants # | |
################################################## | |
# curl constants: | |
HOST="bkestelman-1.gce.cloudera.com" | |
CM_USER="admin" | |
CM_PASS="admin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################## | |
# Constants # | |
################################################## | |
delimiter='~' | |
soft_delimiter="," | |
column_limit=9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cloudera.example | |
import org.apache.spark.sql._ | |
import org.apache.spark.sql.types._ | |
import org.apache.spark.sql.functions._ | |
import scala.collection.mutable._ | |
import scala.collection.mutable.ListBuffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//command line args: | |
val buckets = 5 | |
val myBucket = 1//method 2 only | |
//helper functions | |
case class TableWithHash(tableName: String, hash: Int) | |
def hashTable(string: tableName): TableWithHash = { | |
TableWithHash(tableName, (tableName.hashCode % buckets).toInt) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.ml._ | |
import org.apache.spark.ml.tuning._ | |
import org.apache.spark.ml.evaluation._ | |
import org.apache.spark.mllib.regression._ | |
import org.apache.spark.mllib.linalg.DenseVector | |
import org.apache.spark.sql._ | |
import org.apache.spark.ml.classification._ | |
import org.apache.spark.ml.feature._ | |
import sqlContext.implicits._ | |
import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics |