211211import java .util .logging .Level ;
212212import java .util .logging .Logger ;
213213import org .junit .jupiter .api .AfterAll ;
214+ import org .junit .jupiter .api .Assumptions ;
214215import org .junit .jupiter .api .BeforeAll ;
215216import org .junit .jupiter .api .Test ;
216217import org .junit .jupiter .api .Timeout ;
@@ -1271,6 +1272,8 @@ void testLosslessMaxTimestampIntegration() throws InterruptedException {
12711272
12721273 @ Test
12731274 void testListDatasets () {
1275+ // This test queries public datasets, which are not supported by regional endpoints.
1276+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
12741277 Page <Dataset > datasets = bigquery .listDatasets ("bigquery-public-data" );
12751278 Iterator <Dataset > iterator = datasets .iterateAll ().iterator ();
12761279 Set <String > datasetNames = new HashSet <>();
@@ -2131,6 +2134,8 @@ void testCreateTableWithDefaultValueExpression() {
21312134
21322135 @ Test
21332136 void testCreateAndUpdateTableWithPolicyTags () throws IOException {
2137+ // This test queries public datasets, which are not supported by regional endpoints.
2138+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
21342139 // Set up policy tags in the datacatalog service
21352140 try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient .create ()) {
21362141 CreateTaxonomyRequest createTaxonomyRequest =
@@ -2515,6 +2520,8 @@ void testCreateExternalTable() throws InterruptedException {
25152520
25162521 @ Test
25172522 void testSetPermExternalTableSchema () {
2523+ // This test queries public datasets, which are not supported by regional endpoints.
2524+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
25182525 String tableName = "test_create_external_table_perm" ;
25192526 TableId tableId = TableId .of (DATASET , tableName );
25202527 ExternalTableDefinition externalTableDefinition =
@@ -2926,6 +2933,8 @@ void testDeleteNonExistingTable() {
29262933
29272934 @ Test
29282935 void testDeleteJob () {
2936+ // This test queries public datasets, which are not supported by regional endpoints.
2937+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
29292938 String query = "SELECT 17 as foo" ;
29302939 QueryJobConfiguration config = QueryJobConfiguration .of (query );
29312940 String jobName = "jobId_" + UUID .randomUUID ().toString ();
@@ -3188,6 +3197,8 @@ void testListAllTableData() {
31883197
31893198 @ Test
31903199 void testListPageWithStartIndex () {
3200+ // This test queries public datasets, which are not supported by regional endpoints.
3201+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
31913202 String tableName = "midyear_population_agespecific" ;
31923203 TableId tableId = TableId .of (PUBLIC_PROJECT , PUBLIC_DATASET , tableName );
31933204 Table table = bigquery .getTable (tableId );
@@ -3659,6 +3670,8 @@ void testQueryStatistics() throws InterruptedException {
36593670
36603671 @ Test
36613672 void testExecuteSelectDefaultConnectionSettings () throws SQLException {
3673+ // This test queries public datasets, which are not supported by regional endpoints.
3674+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
36623675 // Use the default connection settings
36633676 Connection connection = bigquery .createConnection ();
36643677 String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;" ;
@@ -3669,6 +3682,8 @@ void testExecuteSelectDefaultConnectionSettings() throws SQLException {
36693682
36703683 @ Test
36713684 void testExecuteSelectWithReadApi () throws SQLException {
3685+ // This test queries public datasets, which are not supported by regional endpoints.
3686+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
36723687 final int rowLimit = 5000 ;
36733688 final String QUERY =
36743689 "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s" ;
@@ -3699,6 +3714,8 @@ void testExecuteSelectWithReadApi() throws SQLException {
36993714
37003715 @ Test
37013716 void testExecuteSelectWithFastQueryReadApi () throws SQLException {
3717+ // This test queries public datasets, which are not supported by regional endpoints.
3718+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
37023719 final int rowLimit = 5000 ;
37033720 final String QUERY =
37043721 "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s" ;
@@ -4785,6 +4802,8 @@ void testProjectIDFastSQLQueryWithJobId() {
47854802
47864803 @ Test
47874804 void testLocationFastSQLQueryWithJobId () throws InterruptedException {
4805+ // This test queries public datasets, which are not supported by regional endpoints.
4806+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
47884807 TableId tableIdFastQueryUk = TableId .of (UK_DATASET , "fastquery_testing_table" );
47894808 DatasetInfo infoUK =
47904809 DatasetInfo .newBuilder (UK_DATASET )
@@ -4960,6 +4979,8 @@ void testFastDDLQuery() throws InterruptedException {
49604979
49614980 @ Test
49624981 void testFastQuerySlowDDL () throws InterruptedException {
4982+ // This test queries public datasets, which are not supported by regional endpoints.
4983+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
49634984 String tableName = generateRandomName ("test_table_fast_query_ddl_slow_" );
49644985 // This query take more than 10s to run and should fall back on the old query path
49654986 String slowDdlQuery =
@@ -5061,6 +5082,8 @@ void testQuerySessionSupport() throws InterruptedException {
50615082
50625083 @ Test
50635084 void testLoadSessionSupportWriteChannelConfiguration () throws InterruptedException {
5085+ // This test queries public datasets, which are not supported by regional endpoints.
5086+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
50645087 TableId sessionTableId = TableId .of ("_SESSION" , "test_temp_destination_table_from_file" );
50655088
50665089 WriteChannelConfiguration configuration =
@@ -5288,6 +5311,8 @@ void testTransactionInfo() throws InterruptedException {
52885311 /* TODO(prasmish): replicate the entire test case for executeSelect */
52895312 @ Test
52905313 void testScriptStatistics () throws InterruptedException {
5314+ // This test queries public datasets, which are not supported by regional endpoints.
5315+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
52915316 String script =
52925317 "-- Declare a variable to hold names as an array.\n "
52935318 + "DECLARE top_names ARRAY<STRING>;\n "
@@ -6541,6 +6566,8 @@ void testCancelJob() throws InterruptedException, TimeoutException {
65416566
65426567 @ Test
65436568 void testCancelNonExistingJob () {
6569+ // This test queries public datasets, which are not supported by regional endpoints.
6570+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
65446571 assertFalse (bigquery .cancel ("test_cancel_non_existing_job" ));
65456572 }
65466573
@@ -6677,6 +6704,8 @@ void testInsertWithDecimalTargetTypes()
66776704
66786705 @ Test
66796706 void testLocation () throws Exception {
6707+ // This test queries public datasets, which are not supported by regional endpoints.
6708+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
66806709 String location = "EU" ;
66816710 String wrongLocation = "US" ;
66826711
@@ -7443,6 +7472,8 @@ void testTableResultJobIdAndQueryId() throws InterruptedException {
74437472
74447473 @ Test
74457474 void testStatelessQueriesWithLocation () throws Exception {
7475+ // This test queries public datasets, which are not supported by regional endpoints.
7476+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
74467477 // This test validates BigQueryOption location is used for stateless query by verifying that the
74477478 // stateless query fails when the BigQueryOption location does not match the dataset location.
74487479 String location = "EU" ;
@@ -7608,6 +7639,8 @@ void testInvalidUniverseDomainWithMismatchCredentials() {
76087639
76097640 @ Test
76107641 void testUniverseDomainWithMatchingDomain () {
7642+ // This test queries public datasets, which are not supported by regional endpoints.
7643+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
76117644 // Test a valid domain using the default credentials and Google default universe domain.
76127645 RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper .create ();
76137646 BigQueryOptions bigQueryOptions =
@@ -7701,6 +7734,8 @@ void testExternalMetadataCacheModeFailForNonBiglake() {
77017734
77027735 @ Test
77037736 void testObjectTable () throws InterruptedException {
7737+ // This test queries public datasets, which are not supported by regional endpoints.
7738+ Assumptions .assumeTrue (!RemoteBigQueryHelper .isRegionalEndpoint (bigquery ));
77047739 String tableName = generateRandomName ("test_object_table" );
77057740 TableId tableId = TableId .of (DATASET , tableName );
77067741
0 commit comments