This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------- | |
alter table call_center add constraint cc_d1 foreign key (cc_closed_date_sk) references date_dim (d_date_sk) | |
-------------- | |
Query OK, 6 rows affected (0.03 sec) | |
Records: 6 Duplicates: 0 Warnings: 0 | |
-------------- | |
alter table call_center add constraint cc_d2 foreign key (cc_open_date_sk) references date_dim (d_date_sk) | |
-------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create unique index person_pk on person(person_id); | |
create index person_n1 on person(date_id); | |
create unique index calendar_pk on calendar(date_id) ; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hive> set hive.execution.engine=tez; | |
hive> select split('I crash Tez',' '); | |
Query ID = hue_20140718150505_1eafc45c-6e2b-49f1-9d72-0ec737a72377 | |
Total jobs = 1 | |
Launching Job 1 out of 1 | |
Status: Running (application id: application_1405217363240_0016) | |
Map 1: -/- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) get your inmap from http://inmaps.linkedinlabs.com/ | |
# 2) zoom all the way in and note the url for the individual tiles (I used Charles Proxy to do this, | |
# but right/control-click, "Inspect Element", "Network" tab, then reload page, also works.) | |
# 3) download your tiles | |
# 4) merge the tiles into column-wise strips | |
# 5) merge the column-wise strips into the final high resolution image | |
# download the individual tiles | |
# my inmap happended to be 15 tiles wide and 12 tiles tall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- triangle_counting.sql | |
-- | |
-- get flat file from http://www.vertica.com/benchmark/TriangleCounting/edges.txt.gz | |
-- gunzip & place in /tmp | |
-- | |
create or replace directory GRAPH_DATA as '/tmp'; | |
DROP TABLE ET_EDGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RecursiveCTE (rnum) AS | |
( | |
SELECT 1 AS rnum | |
FROM dual | |
UNION ALL | |
SELECT rnum + 1 | |
FROM RecursiveCTE | |
WHERE rnum < 24 | |
) | |
SELECT rnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
col CURSOR_TYPE for a15 | |
col PROGRAM for a36 | |
select | |
s.program, | |
o.sql_id, | |
o.sql_exec_id, | |
o.cursor_type, | |
o.sql_text | |
from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- open EMP2 tab & browse DATA tab, notice there are 2 open cursors, noting the SQL_EXEC_ID numbers | |
-- | |
PROGRAM SQL_ID SQL_EXEC_ID CURSOR_TYPE SQL_TEXT | |
------------------------------------ ------------- ----------- --------------- ------------------------------------------------------------ | |
SQL Developer apdcq2s3sxn9y 16777216 OPEN SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, | |
oracle@localhost.localdomain (P000) apdcq2s3sxn9y 16777216 OPEN-RECURSIVE SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, | |
oracle@localhost.localdomain (P001) apdcq2s3sxn9y 16777216 OPEN-RECURSIVE SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, | |
SQL Developer apdcq2s3sxn9y 16777217 OPEN SELECT ROWID "ROWID", ORA_ROWSCN "ORA_ROWSCN", EMPNO EMPNO, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table emp2 as select * from emp; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
insert into emp2 select * from emp2; | |
commit; | |
alter table emp2 parallel 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RJDBC) | |
drv <-JDBC("oracle.jdbc.driver.OracleDriver","/Users/grahn/code/jdbc/ojdbc6.jar") | |
conn<-dbConnect(drv,"jdbc:oracle:thin:@grahn-dev.us.oracle.com:1521:orcl","scott","tiger") | |
data <-dbGetQuery(conn, "select * from emp") | |
write.table(data, file="emp.csv", sep = ",", row.names=FALSE) |
OlderNewer