Table of Contents
  • Let's Parse Some HQL

    I wrote a small script to analyze HQL scripts in bulk and find out how various tables are related to each other. Contents of an example file sample.hql are shown below. CREATE TABLE IF NOT EXISTS some_generated_data_table ROW FORMAT DELIMITED FIELDS TERMINATED BY '\001' LOCATION '/tmp/some_datasource_export.csv' AS SELECT b.user_id, b.age, count(distinct a.book_id) AS book_count, avg(a.price) AS average_price, avg(a.num_pages) AS average_num_pages FROM some_external_table a JOIN some_other_external_table b ON a.book_id=b.book_id GROUP BY b.

  • All content by Category or Tags.