imay commented on a change in pull request #1592: Broker load supports function
URL: https://github.com/apache/incubator-doris/pull/1592#discussion_r311381963
##########
File path: fe/src/main/java/org/apache/doris/planner/BrokerScanNode.java
##########
@@ -339,75 +239,189 @@ private void initParams(ParamCreateContext context)
throws AnalysisException, Us
}
params.setProperties(brokerDesc.getProperties());
+ initColumns(context);
+ }
- // We must create a new map here, because we will change this map
later.
- // But fileGroup will be persisted later, so we keep it unchanged.
- if (fileGroup.getExprColumnMap() != null) {
- context.exprMap = Maps.newHashMap(fileGroup.getExprColumnMap());
- } else {
- context.exprMap = null;
- }
- parseExprMap(context.exprMap);
+ private void initColumns(ParamCreateContext context) throws UserException {
+ // This tuple descriptor is used for origin file
+ TupleDescriptor srcTupleDesc =
analyzer.getDescTbl().createTupleDescriptor();
+ context.tupleDescriptor = srcTupleDesc;
+ Map<String, SlotDescriptor> slotDescByName = Maps.newHashMap();
+ context.slotDescByName = slotDescByName;
- // Generate expr
- List<String> fileFieldNames = fileGroup.getFileFieldNames();
- if (fileFieldNames == null) {
- fileFieldNames = Lists.newArrayList();
+ TBrokerScanRangeParams params = context.params;
+ // there are no columns transform
+ List<ImportColumnDesc> originColumnNameToExprList =
context.fileGroup.getColumnExprList();
+ if (originColumnNameToExprList == null ||
originColumnNameToExprList.isEmpty()) {
for (Column column : targetTable.getBaseSchema()) {
- fileFieldNames.add(column.getName());
+ SlotDescriptor slotDesc =
analyzer.getDescTbl().addSlotDescriptor(srcTupleDesc);
+ slotDesc.setType(ScalarType.createType(PrimitiveType.VARCHAR));
+ slotDesc.setIsMaterialized(true);
+ // same as ISSUE A
Review comment:
what is ISSUE A?
----------------------------------------------------------------
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]