Skip to content

Instantly share code, notes, and snippets.

View hyunsik's full-sized avatar
🏠
Working from home

Hyunsik Choi hyunsik

🏠
Working from home
View GitHub Profile
CREATE TABLE table1 (
f1 INT,
nested_field1 RECORD (
f2 INT,
f3 BIGINT
),
f3 TEXT
);
@hyunsik
hyunsik / x.sql
Last active August 29, 2015 14:21
CREATE EXTERNAL TABLE table1 (
title TEXT,
name RECORD (
first_name INT
)
) USING JSON LOCATION '/xxx/json_Table';
{ "title" : "Hand of the King", "name" : { "first_name": "Eddard", "last_name": "Stark"}}
{ "title" : "Assassin", "name" : { "first_name": "Arya", "last_name": "Stark"}}
{ "title" : "Dancing Master", "name" : { "first_name": "Syrio", "last_name": "Forel"}}
@hyunsik
hyunsik / cpp_awesome_links.md
Created May 27, 2015 05:11
C++ Awesome Links
{
"spaces": {
"warehouse": {
"default": true,
"uri": "hdfs://localhost:8020/tajo/warehouse",
"configs": [
{"dfs.client.read.shortcircuit": true},
{"dfs.domain.socket.path": "/var/lib/hadoop-hdfs/..."}
]
},
@hyunsik
hyunsik / playground.rs
Created July 24, 2015 13:03 — forked from anonymous/playground.rs
Shared via Rust Playground
fn filter<T>(res: &mut [usize], lhs: &[T], rhs: &[T])
where T : Copy + PartialOrd {
let mut matched: usize = 0;
for x in 0..lhs.len() {
res[matched] = x;
matched = matched + if lhs[x] > rhs[x] { 1 } else { 0 };
}
}
@hyunsik
hyunsik / NativeInvoke.java
Created September 25, 2015 11:23
JNI Native Interface
public class NativeInvoke {
public static native void procedure();
public static native void stringArg(String str);
public static native String returnString();
}
@hyunsik
hyunsik / lib.rs
Created September 25, 2015 11:24
Native Implementation in Rust
#![crate_type="dylib"]
#![feature(libc)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused_variables)]
extern crate libc;
extern crate jni;
@hyunsik
hyunsik / builder.java
Created October 5, 2015 13:19
Builder Pattern Example
let storage = StorageBuilder.newBuilder()
.setURL("file:///tmp/test.csv")
.setType("csv")
.setFieldDelimiter(",")
.setLineDelimiter("\n")
.setEncoding("UTF-8")
.build();
@hyunsik
hyunsik / list_gpg_key.sh
Last active October 9, 2015 18:59
[Code Snippet for Blog] Git에서 GPG key로 signoff 하기 (1)
$ gpg --list-secret-keys | grep ^sec
sub 4096R/4CFE2390 2013-10-16 [expires: 2017-10-16]
# ^--- your key id