clintropolis commented on code in PR #18223:
URL: https://github.com/apache/druid/pull/18223#discussion_r2209307111
##########
sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java:
##########
@@ -583,138 +577,104 @@ public void testSegmentsTable() throws Exception
rows.sort((Object[] row1, Object[] row2) -> ((Comparable)
row1[0]).compareTo(row2[0]));
// total segments = 8
- // segments test1, test2 are published and available
- // segment test3 is served by historical but unpublished or unused
- // segments test4, test5 are not published but available (realtime
segments)
- // segment test2 is both published and served by a realtime server.
-
Assert.assertEquals(8, rows.size());
-
- verifyRow(
- rows.get(0),
- "test1_2010-01-01T00:00:00.000Z_2011-01-01T00:00:00.000Z_version1",
- 100L,
- 0L, //partition_num
- 1L, //num_replicas
- 3L, //numRows
- 1L, //is_published
- 1L, //is_available
- 0L, //is_realtime
- 1L, //is_overshadowed
- null, //is_compacted
- 2L // replication_factor
- );
-
- verifyRow(
- rows.get(1),
- "test2_2011-01-01T00:00:00.000Z_2012-01-01T00:00:00.000Z_version2",
- 100L,
- 0L, //partition_num
- 2L, //x§segment test2 is served by historical and realtime servers
- 3L, //numRows
- 1L, //is_published
- 1L, //is_available
- 0L, //is_realtime
- 0L, //is_overshadowed,
- null, //is_compacted
- 0L // replication_factor
- );
-
- //segment test3 is unpublished and has a NumberedShardSpec with
partitionNum = 2
- verifyRow(
- rows.get(2),
- "test3_2012-01-01T00:00:00.000Z_2013-01-01T00:00:00.000Z_version3_2",
- 100L,
- 2L, //partition_num
- 1L, //num_replicas
- 2L, //numRows
- 0L, //is_published
- 1L, //is_available
- 0L, //is_realtime
- 0L, //is_overshadowed
- null, //is_compacted
- -1L // replication_factor
- );
-
- verifyRow(
- rows.get(3),
- "test4_2014-01-01T00:00:00.000Z_2015-01-01T00:00:00.000Z_version4",
- 100L,
- 0L, //partition_num
- 1L, //num_replicas
- 0L, //numRows
- 0L, //is_published
- 1L, //is_available
- 1L, //is_realtime
- 0L, //is_overshadowed
- null, //is_compacted
- -1L // replication_factor
- );
-
- verifyRow(
- rows.get(4),
- "test5_2015-01-01T00:00:00.000Z_2016-01-01T00:00:00.000Z_version5",
- 100L,
- 0L, //partition_num
- 1L, //num_replicas
- 0L, //numRows
- 0L, //is_published
- 1L, //is_available
- 1L, //is_realtime
- 0L, //is_overshadowed
- null, //is_compacted
- -1L // replication_factor
- );
-
- // wikipedia segments are published and unavailable, num_replicas is 0
- // wikipedia segment 1 and 2 are compacted while 3 are not compacted
- verifyRow(
- rows.get(5),
-
"wikipedia1_2007-01-01T00:00:00.000Z_2008-01-01T00:00:00.000Z_version1",
- 53000L,
- 0L, //partition_num
- 0L, //num_replicas
- 0L, //numRows
- 1L, //is_published
- 0L, //is_available
- 0L, //is_realtime
- 1L, //is_overshadowed
- expectedCompactionState, //is_compacted
- 2L // replication_factor
- );
-
- verifyRow(
- rows.get(6),
-
"wikipedia2_2008-01-01T00:00:00.000Z_2009-01-01T00:00:00.000Z_version2",
- 83000L,
- 0L, //partition_num
- 0L, //num_replicas
- 0L, //numRows
- 1L, //is_published
- 0L, //is_available
- 0L, //is_realtime
- 0L, //is_overshadowed
- expectedCompactionState, //is_compacted
- 0L // replication_factor
- );
-
- verifyRow(
- rows.get(7),
-
"wikipedia3_2009-01-01T00:00:00.000Z_2010-01-01T00:00:00.000Z_version3",
- 47000L,
- 0L, //partition_num
- 0L, //num_replicas
- 0L, //numRows
- 1L, //is_published
- 0L, //is_available
- 0L, //is_realtime
- 0L, //is_overshadowed
- null, //is_compacted
- 2L // replication_factor
- );
-
// Verify value types.
verifyTypes(rows, SystemSchema.SEGMENTS_SIGNATURE);
+
+ // segments test1, test2 are published and available.
+ Object[] segment1Expected = new Object[]{
Review Comment:
nit: when we have to split declarations across rows we usually do 1 entry
per line (except for map key/value pairs)
--
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]