jackjlli commented on code in PR #9424:
URL: https://github.com/apache/pinot/pull/9424#discussion_r975616199
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/converter/RealtimeSegmentConverter.java:
##########
@@ -49,34 +49,26 @@ public class RealtimeSegmentConverter {
private final String _segmentName;
private final String _sortedColumn;
private final List<String> _invertedIndexColumns;
- private final List<String> _textIndexColumns;
- private final List<String> _fstIndexColumns;
- private final List<String> _noDictionaryColumns;
- private final List<String> _varLengthDictionaryColumns;
+ private final ColumnDescriptionsContainer _columnDescriptionsContainer;
private final boolean _nullHandlingEnabled;
public RealtimeSegmentConverter(MutableSegmentImpl realtimeSegment,
SegmentZKPropsConfig segmentZKPropsConfig,
String outputPath, Schema schema, String tableName, TableConfig
tableConfig, String segmentName,
- String sortedColumn, List<String> invertedIndexColumns, List<String>
textIndexColumns,
- List<String> fstIndexColumns, List<String> noDictionaryColumns,
List<String> varLengthDictionaryColumns,
- boolean nullHandlingEnabled) {
+ ColumnDescriptionsContainer cdc, boolean nullHandlingEnabled) {
_realtimeSegmentImpl = realtimeSegment;
_segmentZKPropsConfig = segmentZKPropsConfig;
_outputPath = outputPath;
- _invertedIndexColumns = new ArrayList<>(invertedIndexColumns);
- if (sortedColumn != null) {
- _invertedIndexColumns.remove(sortedColumn);
+ _columnDescriptionsContainer = cdc;
+ _invertedIndexColumns = new
ArrayList<>(_columnDescriptionsContainer.getInvertedIndexColumns());
+ if (cdc.getSortedColumn() != null) {
+ _invertedIndexColumns.remove(cdc.getSortedColumn());
}
_dataSchema = getUpdatedSchema(schema);
- _sortedColumn = sortedColumn;
+ _sortedColumn = cdc.getSortedColumn();
_tableName = tableName;
_tableConfig = tableConfig;
_segmentName = segmentName;
- _noDictionaryColumns = noDictionaryColumns;
Review Comment:
I mean we should either only keep `_columnIndicesForRealtimeTable`, or only
keep the other variables like `_invertedIndexColumns`, `_textIndexColumns`,
etc. Keeping both in the same class makes it harder to maintain the code in the
future. E.g. ppl can choose the index config either from the instance variable,
or from the one in `_columnIndicesForRealtimeTable`. I prefer keeping them
respectively as instance variables as it makes less confusion, and all the
preprocessing procedures of those indices have been done in constructor before
they are used in the class.
--
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]