@@ -206,30 +206,32 @@ long getMaxExpectedRowCount(long expectedRowCount, long scaleFactor) {
206206 }
207207
208208 String getReadOperation (int scaleFactor , long rowCount , String ... loadColumns ) {
209+ var headRows = (rowCount >= getGeneratedRowCount ())?"" :".head(${rows})" ;
209210 if (scaleFactor > 1 && mainTable .equals ("timed" ) && Arrays .asList (loadColumns ).contains ("timestamp" )) {
210211 var read = """
211212 merge([
212- read('/data/timed.parquet').view(formulas=[${loadColumns}])
213+ read('/data/timed.parquet').view(formulas=[${loadColumns}])${headRows}
213214 ] * ${scaleFactor}).update_view([
214215 'timestamp=timestamp.plusMillis((long)(ii / ${rows}) * ${rows})'
215- ]).head(${rows}). select()
216+ ]).select()
216217 """ ;
218+ read = read .replace ("${headRows}" ,headRows );
217219 return read .replace ("${scaleFactor}" , "" + scaleFactor ).replace ("${rows}" , "" + rowCount );
218220 }
219221
220- var read = "read('/data/${mainTable}.parquet').head(${rows}) .select(formulas=[${loadColumns}])" ;
222+ var read = "read('/data/${mainTable}.parquet')${headRows} .select(formulas=[${loadColumns}])" ;
221223 read = (loadColumns .length == 0 ) ? ("empty_table(${rows})" ) : read ;
222224
223225 if (scaleFactor > 1 ) {
224226 read = "merge([${readTable}] * ${scaleFactor})" .replace ("${readTable}" , read );
225227 read = read .replace ("${scaleFactor}" , "" + scaleFactor );
226228 }
227- return read .replace ("${rows}" , "" + rowCount );
229+ return read .replace ("${headRows}" , headRows ). replace ( "${ rows}" , "" + rowCount );
228230 }
229231
230- String getStaticQuery (String name , String operation , long warmupRows , String ... loadColumns ) {
232+ String getStaticQuery (String name , String operation , long rowCount , String ... loadColumns ) {
231233 var staticQuery = """
232- source = right = timed = result = None
234+ source = right = timed = result = stats = None
233235 bench_api_metrics_init()
234236 ${loadSupportTables}
235237 ${mainTable} = ${readTable}
@@ -253,13 +255,13 @@ String getStaticQuery(String name, String operation, long warmupRows, String...
253255 long_col("result_row_count", [result.size]),
254256 ])
255257 """ ;
256- var read = getReadOperation (staticFactor , warmupRows , loadColumns );
258+ var read = getReadOperation (staticFactor , rowCount , loadColumns );
257259 return populateQuery (name , staticQuery , operation , read , loadColumns );
258260 }
259261
260- String getIncQuery (String name , String operation , long warmupRows , String ... loadColumns ) {
262+ String getIncQuery (String name , String operation , long rowCount , String ... loadColumns ) {
261263 var incQuery = """
262- source = right = timed = result = source_filter = right_filter = autotune = None
264+ source = right = timed = result = source_filter = right_filter = autotune = stats = None
263265 bench_api_metrics_init()
264266 ${loadSupportTables}
265267 ${mainTable} = ${readTable}
@@ -299,7 +301,7 @@ String getIncQuery(String name, String operation, long warmupRows, String... loa
299301 long_col("result_row_count", [result.size])
300302 ])
301303 """ ;
302- var read = getReadOperation (staticFactor , warmupRows , loadColumns );
304+ var read = getReadOperation (incFactor , rowCount , loadColumns );
303305 return populateQuery (name , incQuery , operation , read , loadColumns );
304306 }
305307
0 commit comments