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
import matplotlib.style as style | |
plt.rcParams.update({'font.size': 16}) | |
plt.rc('axes', titlesize=16) # fontsize of the axes title | |
plt.rc('axes', labelsize=16) # fontsize of the x and y labels | |
plt.rc('xtick', labelsize=16) | |
plt.rc('ytick', labelsize=16) | |
unique_dates = df_grouped[date].unique() | |
days_in_dataset = len(unique_dates) |
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
%%capture | |
fig, ax = plt.subplots(figsize = (15, 11)) |
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
use admin | |
db.createUser( { user: "admin", | |
pwd: "************", | |
roles: [ "userAdminAnyDatabase", | |
"dbAdminAnyDatabase", | |
"readWriteAnyDatabase" | |
] } ) | |
use dqdict |
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
# This file contains the commands I use to build the latestTalend Open Source version | |
# Create a directory where the whole GIT files are to be downloaded | |
# The best way to download the Talend source files as of writing this Gist is to go to URL: https://github.com/Talend/studio-se-master | |
# and follow the instructions there. | |
# Make sure you have already downloaded and installed Maven from https://maven.apache.org/download.cgi, also gits. | |
# We have used a current version of Java 8 | |
mkdir /opt/talend |
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
SET constraint_exclusion = on; | |
EXPLAIN select count(*) from partitioned.transaction where customer_id = 'A5162879360' |
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
delete from partitioned.transaction_bucket_8 |
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
select * from partitioned.transaction_bucket_8 |
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
insert into partitioned.transaction select * from transaction limit 10000 |
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 TRIGGER transaction_insert_trigger | |
BEFORE INSERT | |
ON partitioned.transaction | |
FOR EACH ROW | |
EXECUTE PROCEDURE partitioned.transaction_insert_trigger(); |
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 OR REPLACE FUNCTION partitioned.transaction_insert_trigger() | |
RETURNS trigger AS | |
$BODY$ | |
DECLARE | |
bucket integer; | |
BEGIN | |
bucket := partitioned.calcbucket(NEW.customer_id, 50); | |
INSERT INTO partitioned.bucket_debug VALUES (bucket, NEW.customer_id); | |
IF (bucket = 0) THEN | |
INSERT INTO partitioned.transaction_bucket_0 VALUES (NEW.*); |
NewerOlder