praveenc7 commented on code in PR #15350:
URL: https://github.com/apache/pinot/pull/15350#discussion_r2060540330
##########
pinot-common/src/thrift/query.thrift:
##########
@@ -32,6 +32,7 @@ struct PinotQuery {
11: optional map<string, string> queryOptions;
12: optional bool explain;
13: optional map<Expression, Expression> expressionOverrideHints;
+ 14: optional bool selectStarQuery;
Review Comment:
When the broker sends the request to server, we
[expand](https://github.com/apache/pinot/blob/c781ff1fff5bd770311d9da85f22c1df9f10077c/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java#L1733)
* column to actual physical columns
So our options are either use this or have a querpOptions indicating this
info to the server. Given QueryOptions felt hacky or not clean used this thrift
proto to pass-down the info
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/combine/merger/SelectionOnlyResultsBlockMerger.java:
##########
@@ -46,15 +50,42 @@ public void mergeResultsBlocks(SelectionResultsBlock
mergedBlock, SelectionResul
DataSchema mergedDataSchema = mergedBlock.getDataSchema();
DataSchema dataSchemaToMerge = blockToMerge.getDataSchema();
assert mergedDataSchema != null && dataSchemaToMerge != null;
- if (!mergedDataSchema.equals(dataSchemaToMerge)) {
- String errorMessage =
- String.format("Data schema mismatch between merged block: %s and
block to merge: %s, drop block to merge",
+ QueryContext mergedQueryContext = mergedBlock.getQueryContext();
+ if (!mergedDataSchema.equals(dataSchemaToMerge) && mergedQueryContext !=
null
+ && mergedQueryContext.isSelectStarQuery()) {
+ Map<String, Integer> mergedBlockIndexMap =
mergedDataSchema.getColumnNameToIndexMap();
+ Map<String, Integer> blockToMergeIndexMap =
dataSchemaToMerge.getColumnNameToIndexMap();
+
+ List<String> commonColumns =
mergedBlockIndexMap.keySet().stream().filter(blockToMergeIndexMap::containsKey)
+ .collect(Collectors.toList());
+
+ if (commonColumns.isEmpty()) {
+ String errorMessage = String.format("No common columns to merge
between merged block:"
+ + " %s and block to merge: %s", mergedDataSchema,
dataSchemaToMerge);
+ LOGGER.debug(errorMessage);
+
mergedBlock.addErrorMessage(QueryErrorMessage.safeMsg(QueryErrorCode.MERGE_RESPONSE,
errorMessage));
Review Comment:
Ideally never, was accounting for unknown path. Could be removed
--
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]