haibow commented on a change in pull request #4774: Refactor virtualColumn
URL: https://github.com/apache/incubator-pinot/pull/4774#discussion_r345466343
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/segment/virtualcolumn/SingleStringVirtualColumnProvider.java
##########
@@ -34,9 +33,11 @@
/**
* Virtual column provider for a virtual column that contains a single string.
*/
-public abstract class SingleStringVirtualColumnProvider extends
BaseVirtualColumnProvider {
+public class SingleStringVirtualColumnProvider extends
BaseVirtualColumnProvider {
- protected abstract String getValue(VirtualColumnContext context);
+ protected String getValue(VirtualColumnContext context) {
+ return context.getFieldSpec().getDefaultNullValue().toString();
Review comment:
Which part does not seem right? For single-value string-type virtual
columns, the default null values are specified during initialization. e.g. for
$segmentName, getValue should return the name of the segment. Previously in
SegmentNameVirtualColumnProvider, getValue returns context.getSegmentName().
Now the segment name is initialized in addBuiltInVirtualColumnsToSegmentSchema
for each segment and stored in the segment schema, so
fieldSpec.getDefaultNullValue should still return the sgment name.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]