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 com.mypackage.SparkSessionBuilder | |
import org.apache.log4j.{Level, LogManager} | |
import org.apache.spark.sql.{DataFrame, SaveMode} | |
import org.joda.time.DateTime | |
import scala.util.control.Breaks._ | |
object DataMover { | |
def main(args: Array[String]): Unit = { |
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/sh | |
# create directories | |
mkdir -p src/{main,test}/{resources,scala/com/company} | |
mkdir -p {nonsvn,project,target} | |
# create build.sbt file | |
echo ' | |
name := "ProjectName" | |
version := "1.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 | |
((!$#)) && echo No branch name, command ignored! && exit 1 | |
git checkout $1 && git submodule foreach --recursive git checkout $1 |
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
$ brew update | |
$ brew install hive |
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
\w -> alphabet / underscore / digit (word-characters) | |
\d -> digit | |
Sample input | |
Set(List((a,2), (b,1), (b,2)), List((a,1)), List((b,1)), List((b,2)), List((a,1), (b,1)), List((a,1), (a,2), (b,1)), List(), List((a,1), (b,1), (b,2)), List((a,1), (a,2), (b,2)), List((a,1), (a,2)), List((a,2), (b,1)), List((a,1), (a,2), (b,1), (b,2)), List((a,2)), List((a,1), (b,2)), List((a,2), (b,2)), List((b,1), (b,2))) | |
Set(List((a,1)), List((b,1)), List((b,2)), List((a,1), (b,1)), List(), List((a,2), (b,1)), List((a,2)), List((a,1), (b,2)), List((a,2), (b,2))) | |
Find expression | |
List(\((\(\w,\d\)(, )*)*\))(, )* |
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
USE `meta`; | |
DROP TABLE IF EXISTS `dbs`; | |
CREATE TABLE `dbs` ( | |
`id` INT NOT NULL AUTO_INCREMENT, | |
`name` VARCHAR(50) NOT NULL, | |
`parallelism` INT NOT NULL DEFAULT 32, | |
`status` BIT(1) NOT NULL DEFAULT b'1', |
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
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
sudo yum install -y apache-maven | |
mvn --version |
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
SELECT | |
(data_length) / POWER(1024, 3) AS tablesize_gb | |
FROM | |
information_schema.tables | |
WHERE | |
table_schema = 'db_name' AND | |
table_name = '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
package com.company.udfs.scalar; | |
import com.facebook.presto.spi.function.Description; | |
import com.facebook.presto.spi.function.ScalarFunction; | |
import com.facebook.presto.spi.function.SqlType; | |
import com.facebook.presto.spi.type.StandardTypes; | |
import com.google.common.hash.Hashing; | |
import com.google.common.io.BaseEncoding; | |
import io.airlift.slice.Slice; | |
import io.airlift.slice.Slices; |
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
Reference files for integration test of a Presto plugin containing hashing-related UDFs |
OlderNewer