timveil / hive-jdbc-driver

An alternative to the "hive standalone" jar for connecting Java applications to Apache Hive via JDBC
Apache License 2.0
40 stars 9 forks source link

improve test database creation and loading #50

Open timveil opened 7 years ago

timveil commented 7 years ago

i currently have scripts for a very simple table in the core > src > test > resources directory but i've really stopped using the "test_table" table found in ddl.sql.

Instead i use data and tables found here.

for example BaseConnectionTest.executeSimpleQuery refers to a table called "master_csv" which is from this baseball statistics database. the ddl for that table is essentially this...

CREATE TABLE master_csv (
  playerID string,
  birthyear bigint,
  birthmonth bigint,
  birthday bigint,
  birthcountry string,
  birthstate string,
  birthcity string,
  deathyear bigint,
  deathmonth bigint,
  deathday bigint,
  deathcountry string,
  deathstate string,
  deathcity string,
  namefirst string,
  namelast string,
  namegiven string,
  weight bigint,
  height bigint,
  bats string,
  throws string,
  debut string,
  finalgame string)
  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\054'
  stored as TEXTFILE;

i need to make it easy to build and load a test dataset and then update all test cases to use that. right now its a mix of old and new and requires manually creating things outside of this project.

timveil commented 7 years ago

used a generator i created to build a random test data file. i need to sync the name of this to the test classes.