Note that the ansi sql standard defines "timestamp" as equivalent to "timestamp without time zone". However Spark's behavior depends on both the version of spark and the file format
format \ spark version | <= 2.0.0 | >= 2.0.1 |
---|
#!/bin/bash | |
# this is a demo of how to remove an argument given with the [-arg value] notation for a specific | |
# [arg] (-T in this case, but easy to modify) | |
echo $@ | |
echo $# | |
i=0 | |
ORIGINAL_ARGS=("$@") | |
TRIMMED_ARGS=() |
#!/usr/bin/env python | |
## Makes it easy to run tests in a loop | |
## Just a small bit of automation around something like | |
## ls quanta_cache.py test/test_quanta_cache.py | entr -r python -m pytest test/test_quanta_cache.py | |
## but that is just complex enough I would never remember | |
## If you want to test `jira.py` in a loop, run: | |
## | |
## test/test_loop.py --test jira.py |
#!/bin/bash | |
my_func() {( | |
# this takes a big shortcut around doing testing & unsetting -- because this entire function | |
# is wrapped in "()", it executes in a subsell, so we can unconditionally unset, without | |
# effecting vars outside | |
unset MASTER | |
echo "do something with MASTER=${MASTER-unset}" | |
)} |
import java.security.PrivilegedExceptionAction | |
import org.apache.hadoop.security.UserGroupInformation | |
import org.apache.hadoop.fs.Path | |
import org.apache.hadoop.fs.FileSystem | |
import org.apache.hadoop.conf.Configuration | |
object AccessControlCheck { | |
val privilegedPath = "/some/path/with/limited/access" |
/* For example, I want to do this: | |
* | |
* sqlContext.catalog.client.getTable("default", "blah").properties | |
* | |
* but none of that is public to me in the shell. Using this, I can now do: | |
* | |
* sqlContext.reflectField("catalog").reflectField("client").reflectMethod("getTable", Seq("default", "blah")).reflectField("properties") | |
* | |
* not perfect, but usable. | |
*/ |
def getValMacro(c: Context)(s: c.Expr[Any]) : c.Expr[Any] = { | |
import c.universe._ | |
val q"val $name = $value" = s.tree | |
c.Expr(value) | |
} | |
def getVal(s: Any) = macro getValMacro | |
getVal{val x = 17} | |
error: exception during macro expansion: |
logfile screenlogs/log.%n | |
deflog on | |
defscrollback 10000 | |
screen 1 | |
#other settings | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]' | |
vbell off | |
autodetach on | |
#Binds |
import java.util.ArrayList; | |
public class Test implements Runnable { | |
public static class OOMer implements Runnable { | |
public void run() { | |
System.out.println("Starting oomer"); | |
ArrayList<byte[]> stuff = new ArrayList<>(); | |
while (true) { | |
stuff.add(new byte[100000000]); |
## this should get loaded by your ~/.Rprofile | |
## either just stick all these definitions right in ~/.Rprofile, or | |
## have ~/.Rprofile source this file, etc. | |
source.dirs <- c( | |
## add any "base" locations here. this is like a "classpath" in java | |
## my default is c("~/myRUtils/src","~/companyRUtils/src","~/publicRUtils"), | |
## but you can use whatever you like | |
paste(Sys.getenv("HOME"),"myRUtils","src", sep="/"), | |
paste(Sys.getenv("HOME"),"companyRUtils","src", sep="/"), |