top of page
Search


Moving Data from Athena to Mongo could not be easier
Sometimes you want to query your DWH and put the data in higher level storage for example Mongo see the following python code that can...
bdata3
Feb 20, 20201 min read


Python - Read key and secret to Athena - from credential file
You don't need to hardcode your credentials in your program just read them - use the following code, read access and secret and select...
bdata3
Feb 20, 20201 min read


Python schedule commands to be run on parallel to the program including os commands
The following code will run os command every 10 second in parallel to your code, the need was raised when using aws with token and need...
bdata3
Feb 12, 20201 min read


You have a Json One line file in Kinesis and you want to split it to lines
Add the following lambda to handle the stream data, and this will add new line '\n' to each line: from __future__ import print_function...
bdata3
Feb 10, 20201 min read


Presto/Python - connect to EMR
You have a presto and you want to connect Python to it .... from pyhive import presto cursor = presto.connect(host='localhost',...
bdata3
Feb 3, 20201 min read


How to copy python variable into clipboard
Michael Yin - wrote a very nice snippet of code for ipython and Jupiter notebook from IPython.core.magic import register_line_magic...
bdata3
Jan 22, 20201 min read


Json / Dict switch keys and values
You want a oneliner python code: res = dict((v,k) for k,v in orig.items()) source: https://stackoverflow.com/questions/1031851/how-do-i-e...
bdata3
Jan 15, 20201 min read


How to read parquet snappy file - and write csv - the quick way
So I would like to check a value of field in parquest file for a row. or I would like to get a parquet to csv file. Use Python of course:...
bdata3
Jan 8, 20201 min read


Great Medium article on SPARK and SQL
You can use SQL including window functions on Spark dataframe nice article on this can be found here : https://medium.com/jbennetcodes/ho...
bdata3
Jan 1, 20201 min read


Calculating Night Shift duration - using SQL - or time tunnel Design pattern Part 1
How can you calculate the number of hours within the night shift (for example between 18-05) or during weekends (Saturday/Sunday)? I...
bdata3
Dec 26, 20192 min read


How to count groups for a sequence SQL
Look on the following Oracle article - how to create groups for sequence records using SQL window functions : select val ,row_number()...
bdata3
Dec 22, 20191 min read


The quickest way to get data from SQL to excel in python
So.... We'll try to give useful ideas, tips and peace of codes for you (and us) to explore and use. in this case the quickest way to get...
bdata3
Dec 7, 20191 min read
Blog: Blog2
bottom of page