Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix auto formatting of throwing blocks" #20334

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,9 @@ public static FunctionManager createTestingFunctionManager()
{
TypeOperators typeOperators = new TypeOperators();
GlobalFunctionCatalog functionCatalog = new GlobalFunctionCatalog(
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
});
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); });
functionCatalog.addFunctions(SystemFunctionBundle.create(new FeaturesConfig(), typeOperators, new BlockTypeOperators(typeOperators), UNKNOWN));
functionCatalog.addFunctions(new InternalFunctionBundle(new LiteralFunction(new InternalBlockEncodingSerde(new BlockEncodingManager(), TESTING_TYPE_MANAGER))));
return new FunctionManager(CatalogServiceProvider.fail(), functionCatalog, LanguageFunctionProvider.DISABLED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2044,9 +2044,7 @@ private void verifyProjection(TableHandle table, List<ConnectorExpression> proje
.map(Variable::getName)
.filter(variableName -> !assignedVariables.contains(variableName))
.findAny()
.ifPresent(variableName -> {
throw new IllegalStateException("Unbound variable: " + variableName);
});
.ifPresent(variableName -> { throw new IllegalStateException("Unbound variable: " + variableName); });
}

@Override
Expand Down Expand Up @@ -2764,15 +2762,9 @@ public MetadataManager build()
GlobalFunctionCatalog globalFunctionCatalog = this.globalFunctionCatalog;
if (globalFunctionCatalog == null) {
globalFunctionCatalog = new GlobalFunctionCatalog(
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
});
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); });
TypeOperators typeOperators = new TypeOperators();
globalFunctionCatalog.addFunctions(SystemFunctionBundle.create(new FeaturesConfig(), typeOperators, new BlockTypeOperators(typeOperators), UNKNOWN));
globalFunctionCatalog.addFunctions(new InternalFunctionBundle(new LiteralFunction(new InternalBlockEncodingSerde(new BlockEncodingManager(), typeManager))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2532,9 +2532,7 @@ private Scope createScopeForView(
analysis.unregisterTableForView();

checkViewStaleness(columns, descriptor.getVisibleFields(), name, table)
.ifPresent(explanation -> {
throw semanticException(VIEW_IS_STALE, table, "View '%s' is stale or in invalid state: %s", name, explanation);
});
.ifPresent(explanation -> { throw semanticException(VIEW_IS_STALE, table, "View '%s' is stale or in invalid state: %s", name, explanation); });

// Derive the type of the view from the stored definition, not from the analysis of the underlying query.
// This is needed in case the underlying table(s) changed and the query in the view now produces types that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,9 @@ public void testSubmittedForDispatchedQuery()
new FunctionManager(
new ConnectorCatalogServiceProvider<>("function provider", new NoConnectorServicesProvider(), ConnectorServices::getFunctionProvider),
new GlobalFunctionCatalog(
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
}),
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); }),
LanguageFunctionProvider.DISABLED),
new QueryMonitorConfig());
CreateTable createTable = new CreateTable(QualifiedName.of("table"), ImmutableList.of(), FAIL, ImmutableList.of(), Optional.empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,9 @@ public void testDuplicateFunctions()

TypeOperators typeOperators = new TypeOperators();
GlobalFunctionCatalog globalFunctionCatalog = new GlobalFunctionCatalog(
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
});
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); });
globalFunctionCatalog.addFunctions(SystemFunctionBundle.create(new FeaturesConfig(), typeOperators, new BlockTypeOperators(typeOperators), NodeVersion.UNKNOWN));
globalFunctionCatalog.addFunctions(functionBundle);
assertThatThrownBy(() -> globalFunctionCatalog.addFunctions(functionBundle))
Expand All @@ -124,15 +118,9 @@ public void testConflictingScalarAggregation()

TypeOperators typeOperators = new TypeOperators();
GlobalFunctionCatalog globalFunctionCatalog = new GlobalFunctionCatalog(
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
});
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); });
globalFunctionCatalog.addFunctions(SystemFunctionBundle.create(new FeaturesConfig(), typeOperators, new BlockTypeOperators(typeOperators), NodeVersion.UNKNOWN));
assertThatThrownBy(() -> globalFunctionCatalog.addFunctions(functions))
.isInstanceOf(IllegalStateException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,9 @@ public PlannerContext build()
parametricTypes.forEach(typeRegistry::addParametricType);

GlobalFunctionCatalog globalFunctionCatalog = new GlobalFunctionCatalog(
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
},
() -> {
throw new UnsupportedOperationException();
});
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); },
() -> { throw new UnsupportedOperationException(); });
globalFunctionCatalog.addFunctions(SystemFunctionBundle.create(featuresConfig, typeOperators, new BlockTypeOperators(typeOperators), UNKNOWN));
functionBundles.forEach(globalFunctionCatalog::addFunctions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ public String toString()
.collect(toMap(
Entry::getKey,
Entry::getValue,
(a, b) -> {
throw new IllegalArgumentException("got duplicate key " + a + ", " + b);
},
(a, b) -> { throw new IllegalArgumentException("got duplicate key " + a + ", " + b); },
TreeMap::new)))
.add("finalSelector=" + finalSelector)
.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,7 @@ public Domain getDomain()
return toMap(
keyMapper,
valueMapper,
(u, v) -> {
throw new IllegalStateException(format("Duplicate values for a key: %s and %s", u, v));
},
(u, v) -> { throw new IllegalStateException(format("Duplicate values for a key: %s and %s", u, v)); },
LinkedHashMap::new);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ public PreparedQuery prepareSelectQuery(
.filter(domains::containsKey)
.filter(column -> columnExpressions.containsKey(column.getColumnName()))
.findFirst()
.ifPresent(column -> {
throw new IllegalArgumentException(format("Column %s has an expression and a constraint attached at the same time", column));
});
.ifPresent(column -> { throw new IllegalArgumentException(format("Column %s has an expression and a constraint attached at the same time", column)); });
}

ImmutableList.Builder<String> conjuncts = ImmutableList.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ public DeltaLakeSessionProperties(
"Internal Delta Lake connector property",
HiveTimestampPrecision.class,
MILLISECONDS,
value -> {
throw new IllegalStateException("The property cannot be set");
},
value -> { throw new IllegalStateException("The property cannot be set"); },
true),
durationProperty(
DYNAMIC_FILTERING_WAIT_TIMEOUT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ public class TestIgniteClient

public static final JdbcClient JDBC_CLIENT = new IgniteClient(
new BaseJdbcConfig(),
session -> {
throw new UnsupportedOperationException();
},
session -> { throw new UnsupportedOperationException(); },
new DefaultQueryBuilder(RemoteQueryModifier.NONE),
new DefaultIdentifierMapping(),
RemoteQueryModifier.NONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1430,9 +1430,7 @@ private ColumnMapping arrayAsJsonColumnMapping(ConnectorSession session, ColumnM
return ColumnMapping.sliceMapping(
jsonType,
arrayAsJsonReadFunction(session, baseElementMapping),
(statement, index, block) -> {
throw new UnsupportedOperationException();
},
(statement, index, block) -> { throw new UnsupportedOperationException(); },
DISABLE_PUSHDOWN);
}

Expand Down Expand Up @@ -1560,9 +1558,7 @@ public Slice readSlice(ResultSet resultSet, int columnIndex)
return utf8Slice(resultSet.getString(columnIndex));
}
},
(statement, index, value) -> {
throw new TrinoException(NOT_SUPPORTED, "Money type is not supported for INSERT");
},
(statement, index, value) -> { throw new TrinoException(NOT_SUPPORTED, "Money type is not supported for INSERT"); },
DISABLE_PUSHDOWN);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ public class TestPostgreSqlClient
new BaseJdbcConfig(),
new PostgreSqlConfig(),
new JdbcStatisticsConfig(),
session -> {
throw new UnsupportedOperationException();
},
session -> { throw new UnsupportedOperationException(); },
new DefaultQueryBuilder(RemoteQueryModifier.NONE),
TESTING_TYPE_MANAGER,
new DefaultIdentifierMapping(),
Expand Down
Loading