Skip to content

Instantly share code, notes, and snippets.

sudo yum -y install java
wget https://download.dremio.com/community-server/2.1.6-201809161906440178-edb5b4d/dremio-community-2.1.6-201809161906440178_edb5b4d_1.noarch.rpm
sudo yum -y install dremio-community-2.1.6-201809161906440178_edb5b4d_1.noarch.rpm
@naren-dremio
naren-dremio / helper_script.sh
Last active October 8, 2018 19:05
Dremio on GKE
# Create a GKE cluster. Replace the options as necessary. Use Google Cloud Shell for easy deployment. Preemtible instances lowers the cost by a lot and ideal for testing.
gcloud beta container --project "naren-dremio" clusters create "dremio" --zone "us-east1-b" --username "admin" --cluster-version "1.9.7-gke.6" --machine-type "n1-standard-4" --image-type "COS" --disk-type "pd-standard" --disk-size "100" --scopes "https://www.googleapis.com/auth/cloud-platform" --num-nodes "2" --enable-cloud-logging --enable-cloud-monitoring --network "projects/naren-dremio/global/networks/default" --subnetwork "projects/naren-dremio/regions/us-east1/subnetworks/default" --addons HorizontalPodAutoscaling,HttpLoadBalancing,KubernetesDashboard --no-enable-autoupgrade --enable-autorepair --preemptible
# Get credentials for the cluster
gcloud container clusters get-credentials dremio --zone=us-east1-b
# Install helm
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gz
tar xvf helm-v2.11.0-linux-am
@naren-dremio
naren-dremio / helper_script.sh
Created October 18, 2018 17:12
Dremio on AKS
# Install azure cli and login
brew update && brew install azure-cli
az login
# Create a k8 cluster and configure it in local kubectl
az aks get-credentials --resource-group cloud-shell-storage-eastus --name dremio
# Open up the k8 dashboard
az aks browse --resource-group cloud-shell-storage-eastus --name dremio
/ Generate some random computer statistics (cpu usage only)
/ You can modify n (number of unique computers), timerange (how long the data is for)
/ freq (how often a computer publishes a statistic) and calls (the number of logged calls)
n:1000; timerange:5D; freq:0D00:01; calls:3000;
depts:`finance`packing`logistics`management`hoopjumping`trading`telesales; startcpu:(til n)!25+n?20; fcn:n*fc:`long$timerange%freq;
computer:([]time:(-0D00:00:10 + fcn?0D00:00:20)+fcn#(.z.p - timerange)+freq*til fc; id:raze fc#'key startcpu)
computer:update `g#id from `time xasc update cpu:{100&3|startcpu[first x]+sums(count x)?-2 -1 -1 0 0 1 1 2}[id] by id from computer
/ And generate some random logged calls
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB/QAAAZ2CAYAAAC1vJ6UAAAMTGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSSWiBCEgJvYlSBAJICaFFEJAq2AhJIKHEmBBE7MqyCq5dREBd0VURRdcCyFpR17oIdtfyUBaVlXWxYEPlTQqs637vve+d75t7/5w55z8lc++dAUCvhi+T5aH6AORLC+QJkaGsSWnpLFIXwAEdUAEb0PgChYwTHx8DoAzd/y5vbgJEdb/mpuL65/x/FQOhSCEAAImHOFOoEORDfAgAvEQgkxcAQGRDve2sApkKT4HYSA4ThFimwtkaXKLCmRpcqbZJSuBCvAcAMo3Pl2cDoNsM9axCQTbk0b0NsbtUKJECoEeGOEgg5gshjoJ4VH7+DBWGdsAp8wue7L9xZg5z8vnZw1hTi1rIYRKFLI8/+/9sx/+W/DzlUAwHOGhieVSCqmbYt9u5M6JVmAZxrzQzNg5iQ4jfSYRqe4hRqlgZlayxR80FCi7sGWBC7C7kh0VDbA5xhDQvNkarz8ySRPAghisELZIU8JK0vktFivBELWeNfEZC3BDOknM5Wt8GvlwdV2V/RpmbzNHy3xaLeEP8r4vFSamanDFqoSQlFmJdiJmK3MRojQ1mVyzmxg7ZyJUJqvztIPYXSSNDNfzYtCx5RILWXp6vGKoXWyqW8GK1uKpAnBSl5dkj4KvzN4G4WSTlJA/xiBSTYoZqEYrCwjW1Y+0iabK2XqxTVhCaoPV9KcuL19rjVFFepEpvA7G5ojBR64sHFcAFqeHHY2UF8UmaPPHMHP74eE0+eBGIAVwQBlhACUcmmAFygKStt6kX/tLMRAA+kINsIAJuWs2QR6p6RgqviaAY/AGRCCiG/ULVsyJQCPWfhrWaqxvIUs8Wqj1ywWOI80E0yIO/lWov6XC0FPAb1Ej+EV0Ac82DQzX3Tx0HamK0GuUQL0tvyJIYTgwjRhEjiM64GR6EB+Ax8BoChy
FROM dremio/dremio-oss:4.1.8
USER root
WORKDIR /opt/dremio/jars
# Add the plugin jar, you can also copy it from a local directory with COPY or ADD command
RUN wget https://<location of jar>.jar && \
chown dremio <plugin>.jar
@naren-dremio
naren-dremio / Main.java
Created April 20, 2020 13:02
JDBC example for Dremio
// Requires JDK 1.8
// Run it with:
// javac Main.java && java -cp .:dremio-jdbc-driver-4.2.1-202004111451200819-0c3ecaea.jar Main
import java.sql.*;
import java.util.Properties;
public class Main {
public static void main(String[] args) {
final String DB_URL = "jdbc:dremio:direct=localhost:31010;";
'''
The following script is intended to provide examples to use Dremio's REST API.
Please refer to the documentation for more information: https://docs.dremio.com/rest-api/
Required library: requests
Python version: 3.7.2
'''
import requests, time
%scala
Class.forName("com.dremio.jdbc.Driver")
val jdbcPort = 31010
val jdbcDatabase = "DREMIO"
val user = ""
val password = ""
val tbl = "postgres.public.actor"
// Create the JDBC URL without passing in the user and password parameters.
jdbcPort = 31010
jdbcDatabase = "DREMIO"
jdbcUsername = ""
jdbcPassword = ""
jdbcUrl = "jdbc:dremio:direct=<host>:31010"
connectionProperties = {
"user" : jdbcUsername,
"password" : jdbcPassword,
"driver" : "com.dremio.jdbc.Driver"