kfaraz commented on code in PR #17567:
URL: https://github.com/apache/druid/pull/17567#discussion_r1886189639
##########
extensions-contrib/materialized-view-selection/src/main/java/org/apache/druid/query/materializedview/DerivativeDataSourceManager.java:
##########
@@ -219,33 +219,36 @@ private void updateDerivatives()
private long getAvgSizePerGranularity(String datasource)
{
return connector.retryWithHandle(
- new HandleCallback<Long>() {
+ new HandleCallback<>()
+ {
Set<Interval> intervals = new HashSet<>();
long totalSize = 0;
+
@Override
public Long withHandle(Handle handle)
{
handle.createQuery(
- StringUtils.format("SELECT start,%1$send%1$s,payload FROM %2$s
WHERE used = true AND dataSource = :dataSource",
Review Comment:
Since the PR already touches too many files, maybe avoid the formatting
changes in this PR and keep it limited to only using the diamond operator.
##########
extensions-contrib/cassandra-storage/src/main/java/org/apache/druid/storage/cassandra/CassandraStorage.java:
##########
@@ -66,7 +66,8 @@ public CassandraStorage(CassandraDataSegmentConfig config)
this.config = config;
indexStorage = new CassandraChunkedStorageProvider(keyspace,
INDEX_TABLE_NAME);
- descriptorStorage = new ColumnFamily<String, String>(DESCRIPTOR_TABLE_NAME,
- StringSerializer.get(), StringSerializer.get());
+ descriptorStorage = new ColumnFamily<>(DESCRIPTOR_TABLE_NAME,
Review Comment:
Please revert the formatting changes from this PR to keep it more
straightforward.
##########
extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/SQLCatalogManager.java:
##########
@@ -209,14 +209,14 @@ public TableMetadata withHandle(Handle handle) throws
NotFoundException
.bind(TABLE_NAME_COL, id.name());
final ResultIterator<TableMetadata> resultIterator =
query.map((index, r, ctx) ->
- new TableMetadata(
- id,
- r.getLong(1),
- r.getLong(2),
- TableMetadata.TableState.fromCode(r.getString(3)),
- tableSpecFromBytes(jsonMapper, r.getString(4),
r.getBytes(5), r.getBytes(6))
- ))
- .iterator();
+ new TableMetadata(
Review Comment:
formatting change
##########
extensions-contrib/sqlserver-metadata-storage/src/main/java/org/apache/druid/metadata/storage/sqlserver/SQLServerConnector.java:
##########
@@ -240,25 +240,26 @@ public Void insertOrUpdate(
final byte[] value)
{
return getDBI().withHandle(
- new HandleCallback<Void>()
+ new HandleCallback<>()
{
@Override
public Void withHandle(Handle handle)
{
handle.createStatement(StringUtils.format(
- "MERGE INTO %1$s WITH (UPDLOCK, HOLDLOCK) as target"
- + " USING "
- + " (:key, :value) as source (%2$s, %3$s)"
- + " ON"
- + " (target.%2$s = source.%2$s)"
- + " WHEN MATCHED THEN UPDATE SET %3$s = :value"
- + " WHEN NOT MATCHED THEN INSERT (%2$s, %3$s) VALUES
(:key, :value)",
- tableName,
- keyColumn,
- valueColumn))
- .bind("key", key)
- .bind("value", value)
- .execute();
+ "MERGE INTO %1$s WITH (UPDLOCK, HOLDLOCK) as target"
Review Comment:
Please revert this and other formatting changes for simplicity. These can be
done separately later, if needed.
##########
extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchAggregatorFactoryTest.java:
##########
@@ -56,7 +56,10 @@ public void makeAggregateCombiner()
sketch2.update("b", new double[] {1});
sketch2.update("c", new double[] {1});
- TestObjectColumnSelector<ArrayOfDoublesSketch> selector = new
TestObjectColumnSelector<ArrayOfDoublesSketch>(new ArrayOfDoublesSketch[]
{sketch1, sketch2});
+ TestObjectColumnSelector<ArrayOfDoublesSketch> selector = new
TestObjectColumnSelector<>(new ArrayOfDoublesSketch[]{
+ sketch1,
+ sketch2
+ });
Review Comment:
Nit: Putting the whole argument in a new line makes it more readable.
```suggestion
TestObjectColumnSelector<ArrayOfDoublesSketch> selector = new
TestObjectColumnSelector<>(
new ArrayOfDoublesSketch[]{sketch1, sketch2}
);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]