write the records that all match. e.g., attribute-value pair w matching 1000 records which all satisfy the query @param buffWriter write buffer @param th the column number @param type the number of records for each kind @param counter the counter @return the counter @throws IOException
(BufferedWriter buffWriter, int th, int type, int counter)
| 29 | * @throws IOException |
| 30 | */ |
| 31 | public static int write_all_matched(BufferedWriter buffWriter, int th, int type, int counter) throws IOException { |
| 32 | int share_num = 2;//the number of the identical record |
| 33 | for (int i = 0; i < type; i++) { |
| 34 | for (int j = 0; j < share_num; j++) { |
| 35 | String csv = table_name + "_id_" + counter; |
| 36 | for (int k = 0; k < key_colnum; k++) { |
| 37 | csv += "," + table_name +"_keyword_" + th + "_" + k; |
| 38 | } |
| 39 | for (int k = 0; k < join_column; k++) { |
| 40 | csv += "," + "join_" + th + "_"+ i + "_" + k; |
| 41 | } |
| 42 | counter++; |
| 43 | buffWriter.write(csv); |
| 44 | buffWriter.newLine(); |
| 45 | buffWriter.flush(); |
| 46 | } |
| 47 | } |
| 48 | return counter; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * write the records that all match. e.g., w matching 1000 records where 100 records satisfy the query. |