19
19
20
20
import static org .apache .beam .sdk .nexmark .NexmarkQueryName .PORTABILITY_BATCH ;
21
21
import static org .apache .beam .sdk .nexmark .NexmarkUtils .PubSubMode .COMBINED ;
22
+ import static org .apache .beam .sdk .nexmark .queries .sql .SqlQueryUtils .createSqlQueries ;
22
23
import static org .apache .beam .vendor .guava .v32_1_2_jre .com .google .common .base .Preconditions .checkArgument ;
23
24
import static org .apache .beam .vendor .guava .v32_1_2_jre .com .google .common .base .Preconditions .checkState ;
24
25
82
83
import org .apache .beam .sdk .nexmark .queries .Query9Model ;
83
84
import org .apache .beam .sdk .nexmark .queries .SessionSideInputJoin ;
84
85
import org .apache .beam .sdk .nexmark .queries .SessionSideInputJoinModel ;
85
- import org .apache .beam .sdk .nexmark .queries .sql .SqlBoundedSideInputJoin ;
86
- import org .apache .beam .sdk .nexmark .queries .sql .SqlQuery0 ;
87
- import org .apache .beam .sdk .nexmark .queries .sql .SqlQuery1 ;
88
- import org .apache .beam .sdk .nexmark .queries .sql .SqlQuery2 ;
89
- import org .apache .beam .sdk .nexmark .queries .sql .SqlQuery3 ;
90
- import org .apache .beam .sdk .nexmark .queries .sql .SqlQuery7 ;
91
86
import org .apache .beam .sdk .testing .PAssert ;
92
87
import org .apache .beam .sdk .testutils .metrics .MetricsReader ;
93
88
import org .apache .beam .sdk .transforms .DoFn ;
@@ -125,9 +120,6 @@ public class NexmarkLauncher<OptionT extends NexmarkOptions> {
125
120
/** Command line parameter value for query language. */
126
121
private static final String SQL = "sql" ;
127
122
128
- /** Command line parameter value for zetasql language. */
129
- private static final String ZETA_SQL = "zetasql" ;
130
-
131
123
/** Minimum number of samples needed for 'stead-state' rate calculation. */
132
124
private static final int MIN_SAMPLES = 9 ;
133
125
/** Minimum length of time over which to consider samples for 'steady-state' rate calculation. */
@@ -1254,10 +1246,6 @@ private boolean isSql() {
1254
1246
return SQL .equalsIgnoreCase (options .getQueryLanguage ());
1255
1247
}
1256
1248
1257
- private boolean isZetaSql () {
1258
- return ZETA_SQL .equalsIgnoreCase (options .getQueryLanguage ());
1259
- }
1260
-
1261
1249
private NexmarkQueryModel getNexmarkQueryModel () {
1262
1250
return models .get (configuration .query );
1263
1251
}
@@ -1267,7 +1255,7 @@ private NexmarkQuery<?> getNexmarkQuery() {
1267
1255
}
1268
1256
1269
1257
private Map <NexmarkQueryName , NexmarkQueryModel > createQueryModels () {
1270
- return ( isSql () || isZetaSql () ) ? createSqlQueryModels () : createJavaQueryModels ();
1258
+ return isSql () ? createSqlQueryModels () : createJavaQueryModels ();
1271
1259
}
1272
1260
1273
1261
private Map <NexmarkQueryName , NexmarkQueryModel > createSqlQueryModels () {
@@ -1294,9 +1282,7 @@ private Map<NexmarkQueryName, NexmarkQueryModel> createJavaQueryModels() {
1294
1282
private Map <NexmarkQueryName , NexmarkQuery > createQueries () {
1295
1283
Map <NexmarkQueryName , NexmarkQuery > defaultQueries ;
1296
1284
if (isSql ()) {
1297
- defaultQueries = createSqlQueries ();
1298
- } else if (isZetaSql ()) {
1299
- defaultQueries = createZetaSqlQueries ();
1285
+ defaultQueries = createSqlQueries (configuration );
1300
1286
} else {
1301
1287
defaultQueries = createJavaQueries ();
1302
1288
}
@@ -1317,60 +1303,6 @@ private Set<NexmarkQueryName> getSkippableQueries() {
1317
1303
return skipQueries ;
1318
1304
}
1319
1305
1320
- private Map <NexmarkQueryName , NexmarkQuery > createSqlQueries () {
1321
- return ImmutableMap .<NexmarkQueryName , NexmarkQuery >builder ()
1322
- .put (
1323
- NexmarkQueryName .PASSTHROUGH ,
1324
- new NexmarkQuery (configuration , SqlQuery0 .calciteSqlQuery0 ()))
1325
- .put (NexmarkQueryName .CURRENCY_CONVERSION , new NexmarkQuery (configuration , new SqlQuery1 ()))
1326
- .put (
1327
- NexmarkQueryName .SELECTION ,
1328
- new NexmarkQuery (configuration , SqlQuery2 .calciteSqlQuery2 (configuration .auctionSkip )))
1329
- .put (
1330
- NexmarkQueryName .LOCAL_ITEM_SUGGESTION ,
1331
- new NexmarkQuery (configuration , SqlQuery3 .calciteSqlQuery3 (configuration )))
1332
-
1333
- // SqlQuery5 is disabled for now, uses non-equi-joins,
1334
- // never worked right, was giving incorrect results.
1335
- // Gets rejected after PR/8301, causing failures.
1336
- //
1337
- // See:
1338
- // https://github.com/apache/beam/issues/19541
1339
- // https://github.com/apache/beam/pull/8301
1340
- // https://github.com/apache/beam/pull/8422#issuecomment-487676350
1341
- //
1342
- // .put(
1343
- // NexmarkQueryName.HOT_ITEMS,
1344
- // new NexmarkQuery(configuration, new SqlQuery5(configuration)))
1345
- .put (
1346
- NexmarkQueryName .HIGHEST_BID ,
1347
- new NexmarkQuery (configuration , new SqlQuery7 (configuration )))
1348
- .put (
1349
- NexmarkQueryName .BOUNDED_SIDE_INPUT_JOIN ,
1350
- new NexmarkQuery (
1351
- configuration ,
1352
- SqlBoundedSideInputJoin .calciteSqlBoundedSideInputJoin (configuration )))
1353
- .build ();
1354
- }
1355
-
1356
- private Map <NexmarkQueryName , NexmarkQuery > createZetaSqlQueries () {
1357
- return ImmutableMap .<NexmarkQueryName , NexmarkQuery >builder ()
1358
- .put (
1359
- NexmarkQueryName .PASSTHROUGH ,
1360
- new NexmarkQuery (configuration , SqlQuery0 .zetaSqlQuery0 ()))
1361
- .put (
1362
- NexmarkQueryName .SELECTION ,
1363
- new NexmarkQuery (configuration , SqlQuery2 .zetaSqlQuery2 (configuration .auctionSkip )))
1364
- .put (
1365
- NexmarkQueryName .LOCAL_ITEM_SUGGESTION ,
1366
- new NexmarkQuery (configuration , SqlQuery3 .zetaSqlQuery3 (configuration )))
1367
- .put (
1368
- NexmarkQueryName .BOUNDED_SIDE_INPUT_JOIN ,
1369
- new NexmarkQuery (
1370
- configuration , SqlBoundedSideInputJoin .zetaSqlBoundedSideInputJoin (configuration )))
1371
- .build ();
1372
- }
1373
-
1374
1306
private Map <NexmarkQueryName , NexmarkQuery > createJavaQueries () {
1375
1307
return ImmutableMap .<NexmarkQueryName , NexmarkQuery >builder ()
1376
1308
.put (NexmarkQueryName .PASSTHROUGH , new NexmarkQuery (configuration , new Query0 ()))
0 commit comments