Closed shanealv closed 6 years ago
@shanealv @Jbvaldez @Cgood627 batchinsert (issue #7) is done. Will be able to do further tests once the query program is done. Here is a sample run:
abdu@abdu-VirtualBox:~/cs582/javaminibase/src$ pwd
/home/abdu/cs582/javaminibase/src
abdu@abdu-VirtualBox:~/cs582/javaminibase/src$ java tools.batchinsert /home/abdu/Project-Phase2_test.txt batchinsert_db column 4
Creating a new database (batchinsert_db).
Replacer: Clock
Inserting records into table_1_column.
1000 records inserted. Table table_1_column has 1000 records.
elapsed time: 217 ms
Input file used (this is the same file provided by the TA, you can find it on canvas):
abdu@abdu-VirtualBox:~$ head Project-Phase2_test.txt
ID:Int Name:String Major:String Credit:Float
0 Jose Biology 90
1 Paul Athletics 73
2 Barry Marketing 28
3 Carol Cybernetics 84
4 Jared MechEng 117
5 Juanita Geology 100
6 Fay Psychology 48
7 Donald Athletics 128
8 Steven Languages 81
Implement a program
batchinsert
. Given the command line invocation:where
DATAFILENAME
,DBNAME
,DBTYPE
are string inputs andNUMCOLUMNS
is an integer input.DATAFILENAME
= name of the data file (which includes the path to the file)DBNAME
= name of the databaseDBTYPE
= type of the database. This input can only have two values: “row” or “column”. You should store there records appropriately depending on the chosen input (i.e. if “row” is chosen, the data should be stored in a row-oriented architecture, which is the default for Minibase. If “column” is chosen, then you should store the data in a column-oriented architecture).NUMCOLUMNS
= number of columns in the input dataIf the
DBNAME
already exists, then the program should insert the tuples into the existing database. Regardless of theDBTYPE
, no two databases can have the sameDBNAME
.The format of the data file will be as follows:
At the end of the program, the program should output the number of disk pages that were read and the number ofdisk pages that were written (if any).