@@ -463,7 +463,7 @@ def query_sso_maps(self, sso_name, *, sso_type="ALL", missions=__ALL_STRING,
463
463
.astropy/astroquery/cache. Defaults to True.
464
464
row_limit : int, optional
465
465
Determines how many rows that will be fetched from the database
466
- for each mission.
466
+ for each mission. Can be -1 to select maximum (currently 100 000).
467
467
Defaults to 10000.
468
468
469
469
Returns
@@ -513,15 +513,18 @@ def query_sso_maps(self, sso_name, *, sso_type="ALL", missions=__ALL_STRING,
513
513
514
514
sso_type = self ._get_sso_db_type (sso ['sso_type' ])
515
515
sso_db_identifier = self ._get_db_sso_identifier (sso ['sso_type' ])
516
+ top = ""
517
+ if sanitized_row_limit > 0 :
518
+ top = "TOP {row_limit} " .format (sanitized_row_limit )
516
519
for name in sanitized_missions :
517
520
data_table = self ._find_mission_tap_table_name (sso_json , name )
518
521
mission_json = self ._find_mission_parameters_in_json (data_table , sso_json )
519
522
x_match_table = mission_json ['ssoXMatchTapTable' ]
520
- query = 'SELECT TOP {row_limit} * FROM {data_table} AS a JOIN {x_match_table} AS b ' \
523
+ query = 'SELECT {top} * FROM {data_table} AS a JOIN {x_match_table} AS b ' \
521
524
'ON a.observation_oid = b.observation_oid JOIN sso.ssoid AS c ' \
522
525
'ON b.sso_oid = c.sso_oid WHERE c.{sso_db_identifier} = \' {sso_name}\' ' \
523
526
'AND c.sso_type = \' {sso_type}\' ' \
524
- .format (row_limit = sanitized_row_limit , data_table = data_table , x_match_table = x_match_table ,
527
+ .format (top = top , data_table = data_table , x_match_table = x_match_table ,
525
528
sso_db_identifier = sso_db_identifier , sso_name = sso ['sso_name' ], sso_type = sso_type )
526
529
table = self .query (query )
527
530
if len (table ) > 0 :
0 commit comments