gortiz commented on code in PR #13673:
URL: https://github.com/apache/pinot/pull/13673#discussion_r1734235460
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -1510,87 +1511,30 @@ private BrokerResponseNative
processLiteralOnlyQuery(long requestId, PinotQuery
}
// TODO(xiangfu): Move Literal function computation here from Calcite Parser.
- private void computeResultsForExpression(Expression e, List<String>
columnNames,
- List<DataSchema.ColumnDataType> columnTypes, List<Object> row) {
- if (e.getType() == ExpressionType.LITERAL) {
- computeResultsForLiteral(e.getLiteral(), columnNames, columnTypes, row);
- }
- if (e.getType() == ExpressionType.FUNCTION) {
- if (e.getFunctionCall().getOperator().equals("as")) {
- String columnName =
e.getFunctionCall().getOperands().get(1).getIdentifier().getName();
- computeResultsForExpression(e.getFunctionCall().getOperands().get(0),
columnNames, columnTypes, row);
- columnNames.set(columnNames.size() - 1, columnName);
+ private void computeResultsForExpression(Expression expression, String[]
columnNames, ColumnDataType[] columnTypes,
+ Object[] values, int index) {
+ if (expression.getType() == ExpressionType.LITERAL) {
+ computeResultsForLiteral(expression.getLiteral(), columnNames,
columnTypes, values, index);
+ }
+ if (expression.getType() == ExpressionType.FUNCTION) {
Review Comment:
nit: AFAIU `computeResultsForLiteral` cannot change `expressiong.getType()`.
Am I right? In that case can we add a `else` to this `if (expression.getType()
== ExpressionType.FUNCTION) {` to improve readability?
--
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]