write the records that all match. e.g., w matching 1000 records where 100 records satisfy the query. @param buffWriter @param th the column number @param all_type total number of the record for the w, i.e., 1000 @param part_type partly number, 100,200,...,1000 @param counter @return @throws IOExcept
(BufferedWriter buffWriter, int th, int all_type, int part_type, int counter)
| 59 | * @throws IOException |
| 60 | */ |
| 61 | public static int write_partly_matched(BufferedWriter buffWriter, int th, int all_type, int part_type, int counter) throws IOException { |
| 62 | int share_num = 2; |
| 63 | int cnt = 0; |
| 64 | for (int i = 0; i < all_type; i++) { |
| 65 | for (int k = 0; k < share_num; k++) { |
| 66 | String csv = table_name + "_id_" + counter; |
| 67 | if (cnt < part_type){ |
| 68 | for (int j = 0; j < key_colnum; j++) { |
| 69 | csv += "," + table_name +"_keyword_" + th + "_" + j; |
| 70 | } |
| 71 | for (int j = 0; j < join_column; j++) { |
| 72 | csv += "," + "join_" + th + "_" + i + "_" + j; |
| 73 | } |
| 74 | }else { |
| 75 | for (int j = 0; j < key_colnum; j++) { |
| 76 | csv += "," + table_name +"_keyword_" + th + "_" + j; |
| 77 | } |
| 78 | for (int j = 0; j < join_column; j++) { |
| 79 | csv += "," + "join_" + th + "_" + not_meet + i + "_" + j; |
| 80 | } |
| 81 | } |
| 82 | counter++; |
| 83 | buffWriter.write(csv); |
| 84 | buffWriter.newLine(); |
| 85 | buffWriter.flush(); |
| 86 | } |
| 87 | cnt++; |
| 88 | } |
| 89 | return counter; |
| 90 | } |
| 91 | |
| 92 | public static void main(String[] args) { |
| 93 | BufferedWriter buffWriter = null; |