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
/* | |
Following queries perform the tests described here - | |
* I run tests with 3 probability distributions, in order - | |
- Log Normal | |
- Normal | |
- Uniform | |
1. I pick random samples (10MM) from the distribution (so I know quantiles apriori) |
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
presto> SET SESSION experimental_functions_enabled=True; | |
SET SESSION | |
# scaling without `relatively` changing (shape of the) distribution should not move medians | |
presto> WITH vector AS ( | |
-> SELECT idx | |
-> FROM ( | |
-> SELECT FLATTEN(TRANSFORM(SEQUENCE(1, 10000), x -> TRANSFORM(SEQUENCE(1, 1000), y -> RANDOM(100000)))) AS seq | |
-> ) | |
-> CROSS JOIN UNNEST(seq) AS _(idx) | |
-> ) |
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
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024M; support was removed in 8.0 | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ------------------< com.facebook.presto:presto-main >------------------- | |
[INFO] Building presto-main 0.242-SNAPSHOT | |
[INFO] --------------------------------[ jar ]--------------------------------- | |
Downloading from nexus: https://maven.thefacebook.com/nexus/content/groups/public/com/facebook/presto/presto-geospatial-toolkit/0.242-SNAPSHOT/maven-metadata.xml | |
Progress (1): 1.5 kB | |
Downloaded from nexus: https://maven.thefacebook.com/nexus/content/groups/public/com/facebook/presto/presto-geospatial-toolkit/0.242-SNAPSHOT/maven-metadata.xml (1.5 kB at 934 B/s) |
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
#### QUESTION NO 5 LIST LESS THAN 10### | |
new_list = [] | |
number_list = [1 ,2 ,3 ,5 ,8 , 13 , 21 , 34 , 55 ,89] | |
input_number = int(input("Enter a number for list\n")) | |
if input_number not in number_list: | |
print("Entered number is not present in listing") | |
else: | |
for number in number_list: | |
if number < input_number: |
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 re | |
import collections | |
class HackerLanguage: | |
def __init__(self, flag_character=':', **kwargs): | |
self.message = '' | |
self.flag_character = flag_character | |
def write(self, message): |
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 os | |
import sys | |
import argparse | |
import multiprocessing | |
import queue | |
BLOCK_SIZE = 8000 | |
def parse_options(): | |
parser = argparse.ArgumentParser(description="find(grep for) a word in argument files") |
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 | |
case | |
when session_category = 2 and y.SessionId is not null | |
then 3 | |
when session_category = 2 | |
then 2 | |
else 1 | |
end session_category | |
, count(distinct x.UserId) user_count | |
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
Ticket|Ticket_Action_Id|Ticket_Action_Type | |
100|10001|Swap | |
100|10002|Swap | |
100|10003|Swap | |
200|20001|Reseat | |
200|20002|Swap | |
200|20003|Reimage | |
300|30001|Reboot | |
300|30002|Swap |