Skip to content

Instantly share code, notes, and snippets.

Randy Zwitch randyzwitch

Block or report user

Report or block randyzwitch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@randyzwitch
randyzwitch / insert_into_omnisci.sql
Created Nov 7, 2019
Insert into statement in OmnISci
View insert_into_omnisci.sql
insert into baywheels_tripdata
select
duration_sec,
start_time,
end_time,
start_station_id,
start_station_name,
start_station_latitude,
start_station_longitude,
end_station_id,
@randyzwitch
randyzwitch / extra_col.sql
Last active Nov 7, 2019
Baywheels extra column schema
View extra_col.sql
--201906 and 201907 files have extra blank column
CREATE TABLE baywheels_tripdata_extracol(
duration_sec INTEGER,
start_time TIMESTAMP,
end_time TIMESTAMP,
start_station_id SMALLINT,
start_station_name TEXT ENCODING DICT,
start_station_latitude FLOAT,
start_station_longitude FLOAT,
end_station_id SMALLINT,
@randyzwitch
randyzwitch / june_2019.sql
Created Nov 6, 2019
June 2019 file fails
View june_2019.sql
omnisql> copy baywheels_tripdata from 's3://baywheels-data/201905-baywheels-tripdata.csv.zip';
Result
Loaded: 182163 recs, Rejected: 0 recs in 2.440000 secs
omnisql> copy baywheels_tripdata from 's3://baywheels-data/201906-baywheels-tripdata.csv.zip';
Result
Loader truncated due to reject count. Processed : 0 recs, Rejected: 191772 recs in 8.323000 secs
@randyzwitch
randyzwitch / alter_table.sql
Created Nov 6, 2019
ALTER TABLE ADD COLUMN in OmniSci
View alter_table.sql
--add column bike_share_for_all_trip, which starts with Jan 2018 file
ALTER TABLE baywheels_tripdata ADD COLUMN bike_share_for_all_trip TEXT ENCODING DICT;
@randyzwitch
randyzwitch / 201801_loadingfailure.sh
Created Nov 6, 2019
Failure to load any records in OmniSci
View 201801_loadingfailure.sh
omnisql> copy baywheels_tripdata from 's3://baywheels-data/201801-fordgobike-tripdata.csv.zip';
Result
Loaded: 0 recs, Rejected: 94802 recs in 5.752000 secs
@randyzwitch
randyzwitch / 2017_baywheels_omnisci.sql
Created Nov 6, 2019
2017 FordGoBike/Baywheels data in OmniSci
View 2017_baywheels_omnisci.sql
--define table for 2017 schema
CREATE TABLE baywheels_tripdata(
duration_sec INTEGER,
start_time TIMESTAMP,
end_time TIMESTAMP,
start_station_id SMALLINT,
start_station_name TEXT ENCODING DICT,
start_station_latitude FLOAT,
start_station_longitude FLOAT,
end_station_id SMALLINT,
@randyzwitch
randyzwitch / customers_nopii.sh
Last active Sep 25, 2019
Limited Select Statement SQL Server to OmnISci
View customers_nopii.sh
#run in OmniSci before import to define table
create table customers_nopii(
customerid TEXT ENCODING DICT,
service_address TEXT ENCODING DICT,
address_geom POLYGON
)
#export custom query to OmniSci
java -cp /opt/omnisci/bin/mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:/path/mssql-jdbc-7.4.1.jre8.jar \
com.mapd.utility.SQLImporter \
@randyzwitch
randyzwitch / sqlserver-to-omnisci.sh
Last active Sep 24, 2019
Example SQL Server to OmniSci SQLImporter code
View sqlserver-to-omnisci.sh
java -cp /opt/omnisci/bin/mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:/path/mssql-jdbc-7.4.1.jre8.jar \
com.mapd.utility.SQLImporter \
-d com.microsoft.sqlserver.jdbc.SQLServerDriver \
-u admin -p HyperInteractive -db omnisci --port 6274 -t customers \
-su sqlserver_user -sp sqlserver_password \
-c "jdbc:sqlserver://localhost:1433;DatabaseName=prod" \
-ss "select * from dbo.customers"
@randyzwitch
randyzwitch / java-version.sh
Created Sep 24, 2019
Checking Java version
View java-version.sh
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
@randyzwitch
randyzwitch / servers-colorbrewer-sequential.json
Created Aug 23, 2019
OmniSci Immerse servers.json with ColorBrewer sequential scales
View servers-colorbrewer-sequential.json
[
{
"customStyles": {
"colors": {
"solid": [
"#ea5545",
"#f46a9b",
"#ef9b20",
"#ede15b",
"#bdcf32",
You can’t perform that action at this time.