diff --git a/presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/BigQuerySplitManager.java b/presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/BigQuerySplitManager.java index 17b5f335153a9..453b31842b552 100644 --- a/presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/BigQuerySplitManager.java +++ b/presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/BigQuerySplitManager.java @@ -36,7 +36,6 @@ import static com.facebook.presto.plugin.bigquery.BigQueryErrorCode.BIGQUERY_FAILED_TO_EXECUTE_QUERY; import static com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession; import static com.google.common.collect.ImmutableList.toImmutableList; -import static java.lang.String.format; import static java.util.Objects.requireNonNull; import static java.util.stream.Collectors.toList; import static java.util.stream.IntStream.range; @@ -131,7 +130,7 @@ private List createEmptyProjection(TableId tableId, int actualPar return splits; } catch (BigQueryException e) { - throw new PrestoException(BIGQUERY_FAILED_TO_EXECUTE_QUERY, format("Failed to compute empty projection"), e); + throw new PrestoException(BIGQUERY_FAILED_TO_EXECUTE_QUERY, "Failed to compute empty projection", e); } } } diff --git a/presto-druid/src/main/java/com/facebook/presto/druid/segment/SmooshedColumnSource.java b/presto-druid/src/main/java/com/facebook/presto/druid/segment/SmooshedColumnSource.java index 21364a3611246..e731bc2617645 100644 --- a/presto-druid/src/main/java/com/facebook/presto/druid/segment/SmooshedColumnSource.java +++ b/presto-druid/src/main/java/com/facebook/presto/druid/segment/SmooshedColumnSource.java @@ -82,7 +82,7 @@ private void loadSmooshFileMetadata() BufferedReader in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(metadata))); String line = in.readLine(); if (line == null) { - throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, format("Malformed metadata file: first line should be version,maxChunkSize,numChunks, got null.")); + throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, "Malformed metadata file: first line should be version,maxChunkSize,numChunks, got null."); } String[] splits = line.split(","); diff --git a/presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/AbstractSqlInvokedFunctionNamespaceManager.java b/presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/AbstractSqlInvokedFunctionNamespaceManager.java index f8701da6284b9..b0bfdbc34d037 100644 --- a/presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/AbstractSqlInvokedFunctionNamespaceManager.java +++ b/presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/AbstractSqlInvokedFunctionNamespaceManager.java @@ -331,7 +331,7 @@ protected ScalarFunctionImplementation sqlInvokedFunctionToImplementation(SqlInv throw new IllegalStateException( format("SqlInvokedFunction %s has BUILTIN implementation type but %s cannot manage BUILTIN functions", function.getSignature().getName(), this.getClass())); case CPP: - throw new IllegalStateException(format("Presto coordinator can not resolve implementation of CPP UDF functions")); + throw new IllegalStateException("Presto coordinator can not resolve implementation of CPP UDF functions"); default: throw new IllegalStateException(format("Unknown function implementation type: %s", implementationType)); } diff --git a/presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java b/presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java index 95a082c4ea0fc..cb55230ed41de 100644 --- a/presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java +++ b/presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java @@ -3509,7 +3509,7 @@ protected Optional getTableEncryptionPropertiesFromTa } if (seenColumns.contains(columnWithSubfield.toString())) { - throw new PrestoException(INVALID_TABLE_PROPERTY, format("The same column/subfield cannot have 2 encryption keys")); + throw new PrestoException(INVALID_TABLE_PROPERTY, "The same column/subfield cannot have 2 encryption keys"); } if (columnWithSubfield.getSubfieldPath().isPresent()) { diff --git a/presto-hive/src/test/java/com/facebook/presto/hive/TestHiveIntegrationSmokeTest.java b/presto-hive/src/test/java/com/facebook/presto/hive/TestHiveIntegrationSmokeTest.java index 815b600881094..27a1df19f6c16 100644 --- a/presto-hive/src/test/java/com/facebook/presto/hive/TestHiveIntegrationSmokeTest.java +++ b/presto-hive/src/test/java/com/facebook/presto/hive/TestHiveIntegrationSmokeTest.java @@ -6395,7 +6395,7 @@ public void testAddTableConstraints() // Negative tests assertQueryFails(addPrimaryKeyStmt, format("Primary key already exists for: %s.%s", getSession().getSchema().get(), tableName)); - assertQueryFails(addUniqueConstraintStmt, format("Constraint already exists: 'uq3'")); + assertQueryFails(addUniqueConstraintStmt, "Constraint already exists: 'uq3'"); String dropNonExistentConstraint = format("ALTER TABLE %s.%s.%s DROP CONSTRAINT missingconstraint", getSession().getCatalog().get(), getSession().getSchema().get(), tableName); assertQueryFails(dropNonExistentConstraint, "Constraint 'missingconstraint' not found"); diff --git a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java index 69bb2433b3f18..e21d87f0182a6 100644 --- a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java +++ b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java @@ -466,7 +466,7 @@ public static Optional> getExternalWorkerLaunc } else { Files.write(catalogDirectoryPath.resolve(format("%s.properties", catalogName)), - format("connector.name=hive").getBytes()); + "connector.name=hive".getBytes()); } // Add catalog with caching always enabled. Files.write(catalogDirectoryPath.resolve(format("%scached.properties", catalogName)), diff --git a/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java b/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java index f61319de689cc..2e5e3aa2093b8 100644 --- a/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java +++ b/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java @@ -391,7 +391,7 @@ public int populateFromQueryResults( throw new PinotException( PINOT_UNEXPECTED_RESPONSE, Optional.of(sql), - String.format("Expected data schema in the response")); + "Expected data schema in the response"); } JsonNode columnDataTypes = dataSchema.get("columnDataTypes"); JsonNode columnNames = dataSchema.get("columnNames"); diff --git a/presto-spark-base/src/test/java/com/facebook/presto/spark/TestPrestoSparkQueryRunner.java b/presto-spark-base/src/test/java/com/facebook/presto/spark/TestPrestoSparkQueryRunner.java index 31f227ff76c1f..1a030f4184c0a 100644 --- a/presto-spark-base/src/test/java/com/facebook/presto/spark/TestPrestoSparkQueryRunner.java +++ b/presto-spark-base/src/test/java/com/facebook/presto/spark/TestPrestoSparkQueryRunner.java @@ -133,10 +133,10 @@ public void testZeroFileCreatorForBucketedTable() { assertUpdate( getSession(), - format("CREATE TABLE hive.hive_test.test_hive_orders_bucketed_join_zero_file WITH (bucketed_by=array['orderkey'], bucket_count=8) AS " + + "CREATE TABLE hive.hive_test.test_hive_orders_bucketed_join_zero_file WITH (bucketed_by=array['orderkey'], bucket_count=8) AS " + "SELECT orderkey, custkey, orderstatus, totalprice, orderdate, orderpriority, clerk, shippriority, comment " + "FROM orders_bucketed " + - "WHERE orderkey = 1"), + "WHERE orderkey = 1", 1); }