MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / execute

Method execute

src/java/simpledb/execution/Query.java:102–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100 }
101
102 public void execute() throws DbException, TransactionAbortedException {
103 TupleDesc td = this.getOutputTupleDesc();
104
105 StringBuilder names = new StringBuilder();
106 for (int i = 0; i < td.numFields(); i++) {
107 names.append(td.getFieldName(i)).append("\t");
108 }
109 System.out.println(names);
110 for (int i = 0; i < names.length() + td.numFields() * 4; i++) {
111 System.out.print("-");
112 }
113 System.out.println();
114
115 this.start();
116 int cnt = 0;
117 while (this.hasNext()) {
118 Tuple tup = this.next();
119 System.out.println(tup);
120 cnt++;
121 }
122 System.out.println("\n " + cnt + " rows.");
123 this.close();
124 }
125}

Callers 1

processNextStatementMethod · 0.95

Calls 8

getOutputTupleDescMethod · 0.95
numFieldsMethod · 0.95
getFieldNameMethod · 0.95
startMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
closeMethod · 0.95
printMethod · 0.80

Tested by

no test coverage detected