Have you ever wanted to know if two database tables were the same? Perhaps you made some changes to a query and wanted to know if the result was still the same.
I was essentially looking for a way to diff two tables in Hive SQL, and used:
(TABLE a EXCEPT TABLE b)
UNION ALL
(TABLE b EXCEPT TABLE a);
Tuesday, 30 May 2017
Saturday, 20 May 2017
Volunteer gardening at Cabramatta High School 🌱
I volunteered at Cabramatta High School yesterday as part of their annual Green Day. It sprinkled for about 5 minutes but the rest was overcast. Perfect for gardening! Students from their Environ Club also helped out. All up the school has 1.5k students and they also have an Intensive English Centre which includes students which are migrants, refugees, and international students.
My group helped weed and mulch their Peace Garden:
I’m most proud of this area. We weeded, pruned, and mulched this section:
The clouds started looking ominous which also meant the photos look a bit dark ☹
We mulched both these areas:
Which involved some ingenious ways of moving mulch:
We also had a trailer which was moved BY HAND, by their teacher. He then proceeded to pull the trailer back to the mulch stash with about 10 kids at the back.
It was a great day and I learnt some neat gardening tricks!
Labels:
gardening,
volunteering
Thursday, 2 February 2017
Unlimited marigold
I removed some of the dead marigold flowers i.e. deadheaded them, and collected their seeds. I didn't realise how easy it was! The seeds were smaller than the ones from the packet, probably because the pot I have is smaller than recommended.
![]() |
Left: a dead marigold head. Centre: removing the petals. Right: Marigold seeds |
Monday, 30 January 2017
Using a wick to water plants while away
I had a four day weekend and used an old cotton t-shirt and some 3 L milk bottles to keep my plants hydrated. It's the same trick I used while I was away for two weeks in December.
The basil and capsicum are growing heaps! The marigold seeds will be ready to be harvested soon.
![]() |
Day 0: I was in a rush so was only able to set up a few pots |
![]() |
Day 5: Most plants were hydrated |
Monday, 23 January 2017
Growing capsicum from store-bought capsicum
I rinsed and dried some seeds inside a capsicum then planted them in a pot. I didn't sow them very carefully and a week later a bunch of them said hi 👋
![]() |
Day 8 after sowing: they've sprouted! |
![]() |
Some of my capsicum seedlings in toilet paper roll pots |
Sunday, 15 January 2017
First basil harvest of 2017
A few months ago I sowed some sweet basil and marigold seeds. When the seedlings came up I repotted them into takeaway containers.
![]() |
Pre-basil harvest |
Today, was the first harvest for the season. Basil can be harvested when it's 30 cm tall or has three sets of true leaves. Mine had seven sets! I snipped off the top three sets of leaves about 2 cm above the node of the next one and added them to lunch. We had basil tomato cheese sandwiches for lunch. The aroma was amazing and a little went a long way.
Saturday, 14 January 2017
Importing CSV/TSV with Teradata SQL Assistant
- Set up Teradata to match the format of your text file
- To choose the delimiter:
- Under Tools → Options, go to Export/Import and select one of the options in 'Use this delimiter between columns', e.g. tab, comma, or pipe
- To skip the first row, e.g. a header line:
- Under Tools → Options, go to Import and select 'Ignore the first record in the import file (Skip Header)'
- Create the table in Teradata
- Run the command:
- CREATE TABLE <TableName> (<column1> <datatype>, <column2> <datatype>, ...) PRIMARY INDEX (<column1>);
- Import the file
- Go to File → Import Data
- Run the command:
- INSERT INTO <TableName> VALUES(?,?);
- where the number of ? matches the number of columns in your data file
- In the popup window, Open your file
- Unset Import mode by selecting File → Import Data
- Check that your table has loaded correctly
- Run the command:
- SELECT * FROM <TableName>;
Labels:
data science,
database,
sql,
teradata
Subscribe to:
Posts (Atom)