Skip to content

Instantly share code, notes, and snippets.


Rajkumar Singh rajkrrsingh

View GitHub Profile
rajkrrsingh / Create MapR-Db Table
Created Aug 9, 2015
code snippet to create maprdb table
View Create MapR-Db Table
private void createTable(String tableName, List<String> cfList)
throws IOException {
final String table = tableName;
final List<String> cfs = cfList;
try {
ugi.doAs(new PrivilegedExceptionAction<Void>() {
public Void run() throws Exception {
if (!admin.tableExists(table)) {
rajkrrsingh / Reading parquet files using the parquet tools
Created Aug 10, 2015
reading parquet files and know meta information of parquet file
View Reading parquet files using the parquet tools
// Building a parquet tools
git clone
cd parquet-mr/parquet-tools/
mvn clean package -Plocal
// know the schema of the parquet file
java -jar parquet-tools-1.6.0rc3-SNAPSHOT.jar schema sample.parquet
// Read parquet file
java -jar parquet-tools-1.6.0rc3-SNAPSHOT.jar cat sample.parquet
rajkrrsingh / Interaction with zookeeper using java code
Last active May 5, 2021
Zookeeper : create,list,update zknodes using java
View Interaction with zookeeper using java code
package com.rajkrrsingh.zk;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
View Apache Drill REST API reference
--get storage plugins
--create storage plugin
curl --request POST --header "ContentType: application/json" --data '{"name": "dfs1", "config": { "type": "file", "enabled": false, "connection": "maprfs:///", "workspaces": null, "formats": null }}'
"result" : "success"
--get specific storage plugin
rajkrrsingh / gist:a86ff86f73e351bdf86c
Created Nov 23, 2015
Redis Server installation on CentOs
View gist:a86ff86f73e351bdf86c
# tar xzf redis-3.0.2.tar.gz
# cd redis-3.0.2
# make
Run Redis Server
rajkrrsingh / Hive Thrift Client in Java
Last active Jul 6, 2021
sample java code to connect hive server using thrift client
View Hive Thrift Client in Java
package com.rajkrrsingh.thrift.client;
import org.apache.hive.service.auth.HiveAuthFactory;
import org.apache.hive.service.auth.PlainSaslHelper;
import org.apache.hive.service.cli.thrift.*;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.transport.TTransport;
rajkrrsingh / HiveServer2 connection with MySQL DB as metastore over
Last active Jul 18, 2016
quick guide to connect HS2 to MySQL DB metastore over SSL
View HiveServer2 connection with MySQL DB as metastore over

Setting up MySQL SSL

# Create clean environment
shell> rm -rf newcerts
shell> mkdir newcerts && cd newcerts

# Create CA certificate
shell> openssl genrsa 2048 > ca-key.pem
shell> openssl req -new -x509 -nodes -days 3600 \
 -key ca-key.pem -out ca.pem
rajkrrsingh /
Last active Feb 20, 2018
LLAP Application demo on HDP2.5 using tpc-ds dataset
su - hdfs 
cd hive-testbench-hive14/
vi hive-testbench-hive14/settings/load-partitioned.sql -- remove G1GC and use Parrallel GC scheme
cd hive-testbench-hive14/
yum install gcc
echo 'export JAVA_HOME=/usr/jdk64/jdk1.8.0_77' >> ~/.bashrc
echo 'PATH=$PATH:$JAVA_HOME/bin' &gt;&gt; ~/.bashrc
  • install wget
  • su - hive
cd /tmp

open hive cli

-- create table
rajkrrsingh /
Created Nov 22, 2016
java program to run Sqoop Command using google SSHXCUTE framework
import net.neoremind.sshxcute.core.SSHExec;
import net.neoremind.sshxcute.core.ConnBean;
import net.neoremind.sshxcute.task.CustomTask;
import net.neoremind.sshxcute.task.impl.ExecCommand;
public class RunSqoopCommand {
public static void main(String args[]) throws Exception{