Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Monday, 28 August 2017

Visualising Australia's radio communication links

Mark Hansen suggested I create the Aussie version of his NZ wireless map, so I did 💁


Please interact with the map by clicking on icons and zooming in and out. Sydney Tower sure has a lot of radio links!

The full screen version is available here.


Instructions and code are available in my Github repository.

Tech used: PostgresSQL, Visual Studio Code, Google Fusion Tables

Saturday, 14 January 2017

Importing CSV/TSV with Teradata SQL Assistant

  1. Set up Teradata to match the format of your text file
    1. 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
    2. 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)'
  2. Create the table in Teradata
    1. Run the command:
      • CREATE TABLE <TableName> (<column1> <datatype>, <column2> <datatype>, ...) PRIMARY INDEX (<column1>);
  3. Import the file
    1. Go to File → Import Data
    2. Run the command:
      • INSERT INTO <TableName> VALUES(?,?);
    3. where the number of ? matches the number of columns in your data file
    4. In the popup window, Open your file
    5. Unset Import mode by selecting File → Import Data
  4. Check that your table has loaded correctly
    1. Run the command:
      • SELECT * FROM <TableName>;

Sunday, 11 December 2016

Find the space used by a Hive table

There are a few ways to identify the space used by a Hive table.

Unfortunately, my Hive wouldn't accept these commands (and I haven't worked out why...):
  • hive > SHOW TBLPROPERTIES <TableName>("rawDataSize")
  • hive > DESCRIBE EXTENDED <TableName>
So I resorted to using the file system shell:
  • hadoop fs -du -h <URI>