Skip to content

Commit cbbbbf9

Browse files
author
Akhtar
committed
csv2colstore
1 parent 94a11e2 commit cbbbbf9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

csv2colstore.cc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#include <sys/stat.h>
2+
#include <sstream>
3+
#include <stdlib.h>
4+
#include <string.h>
5+
#include "library.h"
6+
#include <algorithm>
7+
#include <fstream>
8+
#include <iostream>
9+
#include <sys/timeb.h>
10+
11+
int main(int argc, char *argv[]){
12+
if (argc<4){
13+
std::cout << "USAGE: ./csv2colstore <csv_file> <colstore_name> <page_size>";
14+
return 1;
15+
}
16+
17+
char *dir_colstore;
18+
int size_page, size_record, total_record;
19+
20+
std::ifstream csv_file;
21+
csv_file.open(argv[1]);
22+
if (!csv_file){
23+
std::cout << "Not able to open file " << argv[1] << " line 20 \n";
24+
return 1;
25+
}
26+
27+
*dir_colstore = argv[2];
28+
if (mkdir(dir_colstore, 0700) !== 0){
29+
std :: cout << "Not able to open file " << dir_colstore << "\n";
30+
return 1;
31+
}
32+
size_record = NUM_ATTRIBUTES * ATTRIBUTE_SIZE;
33+
size_page = atoi(argv[3]);
34+
35+
std::vector<Record> *r = new std::vector<Reocrd>();
36+
37+
struct timeb t;
38+
ftime(&t);
39+
long start_time_in_ms = (t.time * 1000) + t.millitm;
40+
41+
}

0 commit comments

Comments
 (0)