tarun11Mavani commented on code in PR #19093:
URL: https://github.com/apache/pinot/pull/19093#discussion_r3975780766
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/openstruct/MutableOpenStructIndex.java:
##########
@@ -119,7 +127,8 @@ public void index(int docId, @Nullable Object value) {
// Resolve stored type and coerce BEFORE allocating a column so a
first-row coercion failure
// does not allocate a column that was never usable.
DataType resolvedType = resolveStoredType(key, rawValue, null);
- Object coerced = tryCoerce(key, rawValue, resolvedType);
+ Object coerced = tryCoerce(key, rawValue,
+ ColumnDataType.fromDataTypeSV(resolvedType).toPinotDataType());
Review Comment:
Went with your second option — rejecting these in
OpenStructIndexType#validate() — since it's a single root-cause fix rather han
restoring try/catch in two call sites.
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/openstruct/MutableOpenStructIndex.java:
##########
@@ -290,15 +299,30 @@ public DataType getStoredType() {
@Override
public void close()
throws IOException {
- if (_ignoredKeyDropCount > 0) {
- ServerMetrics serverMetrics = ServerMetrics.get();
- if (serverMetrics != null) {
- serverMetrics.addMeteredTableValue(_tableNameWithType,
_openStructColumn,
- ServerMeter.OPEN_STRUCT_IGNORED_KEY_DROPS, _ignoredKeyDropCount);
- }
- }
+ flushMeters();
for (MutableKeyColumn keyCol : _keyColumns.values()) {
keyCol.close();
}
}
+
+ /// Emits the batched ingestion counters. Counters accumulate per row on the
consuming path and
+ /// are flushed once here, mirroring what [OpenStructColumnSplitter] does at
seal time.
+ private void flushMeters() {
Review Comment:
done.
--
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]