You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/05/07 06:26:05 UTC
[GitHub] [incubator-pinot] jtao15 opened a new pull request #6891: Allow multiple alias for the same selection column.
jtao15 opened a new pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891
This pr add supports to allow selecting same column multiple times with different alias (#6844 ).
E.g. `Select colA AS xx, colA AS yy from T`.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628407710
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
##########
@@ -91,7 +91,8 @@ private static void updateAlias(QueryContext queryContext, BrokerResponseNative
if (resultTable == null) {
return;
}
- Map<ExpressionContext, String> aliasMap = queryContext.getAliasMap();
+ // Use list to support multiple alias for the same column.
+ Map<ExpressionContext, List<String>> aliasMap = queryContext.getAliasMap();
Review comment:
Even with a list, we still cannot handle cases such as `SELECT colA, colA AS a, colA AS b FROM myTable`. We might need to think of a different way to store the alias if we do want to support it. One possible solution would be keep a list of aliasNames for the select expressions.
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
##########
@@ -104,9 +105,10 @@ private static void updateAlias(QueryContext queryContext, BrokerResponseNative
return;
}
for (int i = 0; i < numSelectExpressions; i++) {
- String alias = aliasMap.get(selectExpressions.get(i));
- if (alias != null) {
- columnNames[i] = alias;
+ List<String> alias = aliasMap.get(selectExpressions.get(i));
+ if (alias != null && alias.size() > 0) {
+ columnNames[i] = alias.get(0);
+ alias.remove(0);
Review comment:
We should avoid modifying the query context in case it is used somewhere else
##########
File path: pinot-core/src/test/java/org/apache/pinot/queries/AliasQueriesTest.java
##########
@@ -0,0 +1,249 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.queries;
+
+import java.io.File;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.common.response.broker.BrokerResponseNative;
+import org.apache.pinot.common.response.broker.ResultTable;
+import org.apache.pinot.common.utils.DataSchema;
+import org.apache.pinot.common.utils.DataSchema.ColumnDataType;
+import org.apache.pinot.segment.local.indexsegment.immutable.ImmutableSegmentLoader;
+import org.apache.pinot.segment.local.segment.creator.impl.SegmentIndexCreationDriverImpl;
+import org.apache.pinot.segment.local.segment.readers.GenericRowRecordReader;
+import org.apache.pinot.segment.spi.ImmutableSegment;
+import org.apache.pinot.segment.spi.IndexSegment;
+import org.apache.pinot.segment.spi.creator.SegmentGeneratorConfig;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableType;
+import org.apache.pinot.spi.data.FieldSpec.DataType;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.data.readers.GenericRow;
+import org.apache.pinot.spi.utils.BigDecimalUtils;
+import org.apache.pinot.spi.utils.ReadMode;
+import org.apache.pinot.spi.utils.builder.TableConfigBuilder;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+
+
+@SuppressWarnings("rawtypes")
+public class AliasQueriesTest extends BaseQueriesTest {
Review comment:
Can we add these test queries into one of the integration test? I feel adding a separate queries test might be too much
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628581113
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
##########
@@ -91,10 +91,7 @@ private static void updateAlias(QueryContext queryContext, BrokerResponseNative
if (resultTable == null) {
return;
}
- Map<ExpressionContext, String> aliasMap = queryContext.getAliasMap();
- if (aliasMap.isEmpty()) {
- return;
- }
+ List<String> aliasList = queryContext.getAliasList();
Review comment:
Do we need to check if it is empty? I think it will be empty for PQL query?
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628619949
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
##########
@@ -464,21 +464,40 @@ public static SelectionResults renderSelectionResultsWithoutOrdering(List<Object
*
* @param rows selection rows.
* @param dataSchema data schema.
+ * @param selectionColumns selection columns.
* @return {@link ResultTable} object results.
*/
- public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema) {
+ public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema, List<String> selectionColumns) {
Review comment:
Can we add some optimization by checking `selectionColumn` size and `dataSchema`size?
If their sizes are equal, we don't need to go through the recreation of objects. We will be able to save some memory resources there. Since this happens for each query, it's good to add the optimization if possible.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-commenter commented on pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#issuecomment-834125903
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#6891](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1484158) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/bb2519494a15a3125dd509286d60ffd124f91c37?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb25194) will **decrease** coverage by `8.02%`.
> The diff coverage is `95.45%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6891/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #6891 +/- ##
============================================
- Coverage 73.55% 65.52% -8.03%
Complexity 12 12
============================================
Files 1423 1423
Lines 70029 70041 +12
Branches 10119 10121 +2
============================================
- Hits 51509 45895 -5614
- Misses 15103 20865 +5762
+ Partials 3417 3281 -136
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| integration | `?` | `?` | |
| unittests | `65.52% <95.45%> (+0.02%)` | `12.00 <0.00> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...pinot/core/query/request/context/QueryContext.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZXF1ZXN0L2NvbnRleHQvUXVlcnlDb250ZXh0LmphdmE=) | `100.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |
| [...e/pinot/core/query/reduce/BrokerReduceService.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvQnJva2VyUmVkdWNlU2VydmljZS5qYXZh) | `68.30% <80.00%> (-25.31%)` | `0.00 <0.00> (ø)` | |
| [...t/core/query/reduce/SelectionDataTableReducer.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvU2VsZWN0aW9uRGF0YVRhYmxlUmVkdWNlci5qYXZh) | `73.58% <100.00%> (-1.89%)` | `0.00 <0.00> (ø)` | |
| [...xt/utils/BrokerRequestToQueryContextConverter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZXF1ZXN0L2NvbnRleHQvdXRpbHMvQnJva2VyUmVxdWVzdFRvUXVlcnlDb250ZXh0Q29udmVydGVyLmphdmE=) | `96.33% <100.00%> (+0.03%)` | `0.00 <0.00> (ø)` | |
| [...t/core/query/selection/SelectionOperatorUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9zZWxlY3Rpb24vU2VsZWN0aW9uT3BlcmF0b3JVdGlscy5qYXZh) | `91.14% <100.00%> (-4.11%)` | `0.00 <0.00> (ø)` | |
| [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...pache/pinot/common/utils/grpc/GrpcQueryClient.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvZ3JwYy9HcnBjUXVlcnlDbGllbnQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...pinot/minion/exception/TaskCancelledException.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXhjZXB0aW9uL1Rhc2tDYW5jZWxsZWRFeGNlcHRpb24uamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| ... and [341 more](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bb25194...1484158](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-commenter edited a comment on pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#issuecomment-834125903
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#6891](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ff58f65) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/bb2519494a15a3125dd509286d60ffd124f91c37?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bb25194) will **decrease** coverage by `30.17%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6891/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #6891 +/- ##
=============================================
- Coverage 73.55% 43.38% -30.18%
+ Complexity 12 7 -5
=============================================
Files 1423 1423
Lines 70029 70038 +9
Branches 10119 10120 +1
=============================================
- Hits 51509 30385 -21124
- Misses 15103 37056 +21953
+ Partials 3417 2597 -820
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| integration | `43.38% <100.00%> (+<0.01%)` | `7.00 <0.00> (ø)` | |
| unittests | `?` | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...e/pinot/core/query/reduce/BrokerReduceService.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvQnJva2VyUmVkdWNlU2VydmljZS5qYXZh) | `94.24% <100.00%> (+0.62%)` | `0.00 <0.00> (ø)` | |
| [...t/core/query/reduce/SelectionDataTableReducer.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvU2VsZWN0aW9uRGF0YVRhYmxlUmVkdWNlci5qYXZh) | `75.47% <100.00%> (ø)` | `0.00 <0.00> (ø)` | |
| [...pinot/core/query/request/context/QueryContext.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZXF1ZXN0L2NvbnRleHQvUXVlcnlDb250ZXh0LmphdmE=) | `97.01% <100.00%> (-2.99%)` | `0.00 <0.00> (ø)` | |
| [...xt/utils/BrokerRequestToQueryContextConverter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZXF1ZXN0L2NvbnRleHQvdXRpbHMvQnJva2VyUmVxdWVzdFRvUXVlcnlDb250ZXh0Q29udmVydGVyLmphdmE=) | `96.33% <100.00%> (+0.03%)` | `0.00 <0.00> (ø)` | |
| [...t/core/query/selection/SelectionOperatorUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9zZWxlY3Rpb24vU2VsZWN0aW9uT3BlcmF0b3JVdGlscy5qYXZh) | `73.11% <100.00%> (-22.14%)` | `0.00 <0.00> (ø)` | |
| [...c/main/java/org/apache/pinot/common/tier/Tier.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdGllci9UaWVyLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...ava/org/apache/pinot/spi/data/MetricFieldSpec.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvZGF0YS9NZXRyaWNGaWVsZFNwZWMuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...a/org/apache/pinot/spi/config/table/TableType.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvY29uZmlnL3RhYmxlL1RhYmxlVHlwZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...a/org/apache/pinot/spi/data/DateTimeFieldSpec.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvZGF0YS9EYXRlVGltZUZpZWxkU3BlYy5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...a/org/apache/pinot/spi/env/PinotConfiguration.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvZW52L1Bpbm90Q29uZmlndXJhdGlvbi5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| ... and [897 more](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bb25194...ff58f65](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628619949
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
##########
@@ -464,21 +464,40 @@ public static SelectionResults renderSelectionResultsWithoutOrdering(List<Object
*
* @param rows selection rows.
* @param dataSchema data schema.
+ * @param selectionColumns selection columns.
* @return {@link ResultTable} object results.
*/
- public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema) {
+ public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema, List<String> selectionColumns) {
Review comment:
Can we add some optimization by checking `selectionColumn` size and `dataSchema`size?
If their size is equal, we don't need to go through the recreation of objects. We will be able to save some memory resources there. Since this happens for each query, it's good to add the optimization if possible.
##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java
##########
@@ -1185,22 +1185,50 @@ public void testQueryWithOrderby()
}
@Test
- public void testQueryWithSameAlias()
+ public void testQueryWithAlias()
Review comment:
Do we have the test for `select *` ?
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
##########
@@ -91,10 +91,7 @@ private static void updateAlias(QueryContext queryContext, BrokerResponseNative
if (resultTable == null) {
return;
}
- Map<ExpressionContext, String> aliasMap = queryContext.getAliasMap();
- if (aliasMap.isEmpty()) {
- return;
- }
+ List<String> aliasList = queryContext.getAliasList();
Review comment:
+1
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
snleee commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628707966
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
##########
@@ -464,21 +464,50 @@ public static SelectionResults renderSelectionResultsWithoutOrdering(List<Object
*
* @param rows selection rows.
* @param dataSchema data schema.
+ * @param selectionColumns selection columns.
* @return {@link ResultTable} object results.
*/
- public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema) {
+ public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema, List<String> selectionColumns) {
int numRows = rows.size();
List<Object[]> resultRows = new ArrayList<>(numRows);
- ColumnDataType[] columnDataTypes = dataSchema.getColumnDataTypes();
- int numColumns = columnDataTypes.length;
+
+ DataSchema resultDataSchema = dataSchema;
+ Map<String, Integer> columnNameToIndexMap = null;
+ if (dataSchema.getColumnNames().length != selectionColumns.size()) {
+ // Create updated data schema since one column can be selected multiple times.
+ columnNameToIndexMap = new HashMap<>(dataSchema.getColumnNames().length);
+ String[] columnNames = dataSchema.getColumnNames();
+ ColumnDataType[] columnDataTypes = dataSchema.getColumnDataTypes();
+ for (int i = 0; i < columnNames.length; i++) {
+ columnNameToIndexMap.put(columnNames[i], i);
+ }
+
+ ColumnDataType[] newColumnDataTypes = new ColumnDataType[selectionColumns.size()];
+ for (int i =0; i < newColumnDataTypes.length; i++) {
Review comment:
please apply the formatting
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
##########
@@ -464,21 +464,50 @@ public static SelectionResults renderSelectionResultsWithoutOrdering(List<Object
*
* @param rows selection rows.
* @param dataSchema data schema.
+ * @param selectionColumns selection columns.
* @return {@link ResultTable} object results.
*/
- public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema) {
+ public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema, List<String> selectionColumns) {
int numRows = rows.size();
List<Object[]> resultRows = new ArrayList<>(numRows);
- ColumnDataType[] columnDataTypes = dataSchema.getColumnDataTypes();
- int numColumns = columnDataTypes.length;
+
+ DataSchema resultDataSchema = dataSchema;
+ Map<String, Integer> columnNameToIndexMap = null;
+ if (dataSchema.getColumnNames().length != selectionColumns.size()) {
+ // Create updated data schema since one column can be selected multiple times.
+ columnNameToIndexMap = new HashMap<>(dataSchema.getColumnNames().length);
+ String[] columnNames = dataSchema.getColumnNames();
+ ColumnDataType[] columnDataTypes = dataSchema.getColumnDataTypes();
+ for (int i = 0; i < columnNames.length; i++) {
+ columnNameToIndexMap.put(columnNames[i], i);
+ }
+
+ ColumnDataType[] newColumnDataTypes = new ColumnDataType[selectionColumns.size()];
+ for (int i =0; i < newColumnDataTypes.length; i++) {
+ int index = columnNameToIndexMap.get(selectionColumns.get(i));
+ newColumnDataTypes[i] = columnDataTypes[index];
+ }
+
+ resultDataSchema = new DataSchema(selectionColumns.toArray(new String[0]), newColumnDataTypes);
+ }
+
+ int numColumns = resultDataSchema.getColumnNames().length;
+ ColumnDataType[] resultColumnDataTypes = resultDataSchema.getColumnDataTypes();
for (Object[] row : rows) {
Object[] resultRow = new Object[numColumns];
for (int i = 0; i < numColumns; i++) {
- resultRow[i] = columnDataTypes[i].convertAndFormat(row[i]);
+ int index;
+ if (columnNameToIndexMap == null) {
+ index = i;
+ } else {
+ index = columnNameToIndexMap.get(selectionColumns.get(i));
+ }
Review comment:
you can make the code a bit shorter
```
int index = (columnNameToIndexMap != null) ? columnNameToIndexMap.get(selectionColumns.get(i)) : i
```
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] jtao15 commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
jtao15 commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628564212
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
##########
@@ -91,7 +91,8 @@ private static void updateAlias(QueryContext queryContext, BrokerResponseNative
if (resultTable == null) {
return;
}
- Map<ExpressionContext, String> aliasMap = queryContext.getAliasMap();
+ // Use list to support multiple alias for the same column.
+ Map<ExpressionContext, List<String>> aliasMap = queryContext.getAliasMap();
Review comment:
Changed to use a list instead of map.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] jtao15 commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
jtao15 commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628664205
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/reduce/BrokerReduceService.java
##########
@@ -91,10 +91,7 @@ private static void updateAlias(QueryContext queryContext, BrokerResponseNative
if (resultTable == null) {
return;
}
- Map<ExpressionContext, String> aliasMap = queryContext.getAliasMap();
- if (aliasMap.isEmpty()) {
- return;
- }
+ List<String> aliasList = queryContext.getAliasList();
Review comment:
Yes, it's empty for PQL. Added it back to short circuit for PQL.
##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java
##########
@@ -1185,22 +1185,50 @@ public void testQueryWithOrderby()
}
@Test
- public void testQueryWithSameAlias()
+ public void testQueryWithAlias()
Review comment:
There are some other tests in the class to cover `select *`.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] snleee merged pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
snleee merged pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-commenter edited a comment on pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#issuecomment-834125903
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#6891](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8fb3467) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/d6f4415a5ae6ed65b37522994563ff21d3d6004c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d6f4415) will **decrease** coverage by `8.13%`.
> The diff coverage is `59.37%`.
> :exclamation: Current head 8fb3467 differs from pull request most recent head 00d34b3. Consider uploading reports for the commit 00d34b3 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6891/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #6891 +/- ##
============================================
- Coverage 73.63% 65.50% -8.14%
Complexity 12 12
============================================
Files 1423 1423
Lines 70031 70048 +17
Branches 10119 10123 +4
============================================
- Hits 51570 45885 -5685
- Misses 15057 20881 +5824
+ Partials 3404 3282 -122
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| integration | `?` | `?` | |
| unittests | `65.50% <59.37%> (-0.02%)` | `12.00 <0.00> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...t/core/query/selection/SelectionOperatorUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9zZWxlY3Rpb24vU2VsZWN0aW9uT3BlcmF0b3JVdGlscy5qYXZh) | `85.85% <35.00%> (-9.41%)` | `0.00 <0.00> (ø)` | |
| [...e/pinot/core/query/reduce/BrokerReduceService.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvQnJva2VyUmVkdWNlU2VydmljZS5qYXZh) | `70.21% <100.00%> (-23.41%)` | `0.00 <0.00> (ø)` | |
| [...t/core/query/reduce/SelectionDataTableReducer.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZWR1Y2UvU2VsZWN0aW9uRGF0YVRhYmxlUmVkdWNlci5qYXZh) | `73.58% <100.00%> (-1.89%)` | `0.00 <0.00> (ø)` | |
| [...pinot/core/query/request/context/QueryContext.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZXF1ZXN0L2NvbnRleHQvUXVlcnlDb250ZXh0LmphdmE=) | `100.00% <100.00%> (ø)` | `0.00 <0.00> (ø)` | |
| [...xt/utils/BrokerRequestToQueryContextConverter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9yZXF1ZXN0L2NvbnRleHQvdXRpbHMvQnJva2VyUmVxdWVzdFRvUXVlcnlDb250ZXh0Q29udmVydGVyLmphdmE=) | `96.33% <100.00%> (+0.03%)` | `0.00 <0.00> (ø)` | |
| [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...pache/pinot/common/utils/grpc/GrpcQueryClient.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvZ3JwYy9HcnBjUXVlcnlDbGllbnQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| [...pinot/minion/exception/TaskCancelledException.java](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vZXhjZXB0aW9uL1Rhc2tDYW5jZWxsZWRFeGNlcHRpb24uamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (ø%)` | |
| ... and [345 more](https://codecov.io/gh/apache/incubator-pinot/pull/6891/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d6f4415...00d34b3](https://codecov.io/gh/apache/incubator-pinot/pull/6891?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] jtao15 commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
jtao15 commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628564298
##########
File path: pinot-core/src/test/java/org/apache/pinot/queries/AliasQueriesTest.java
##########
@@ -0,0 +1,249 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.queries;
+
+import java.io.File;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+import org.apache.commons.io.FileUtils;
+import org.apache.pinot.common.response.broker.BrokerResponseNative;
+import org.apache.pinot.common.response.broker.ResultTable;
+import org.apache.pinot.common.utils.DataSchema;
+import org.apache.pinot.common.utils.DataSchema.ColumnDataType;
+import org.apache.pinot.segment.local.indexsegment.immutable.ImmutableSegmentLoader;
+import org.apache.pinot.segment.local.segment.creator.impl.SegmentIndexCreationDriverImpl;
+import org.apache.pinot.segment.local.segment.readers.GenericRowRecordReader;
+import org.apache.pinot.segment.spi.ImmutableSegment;
+import org.apache.pinot.segment.spi.IndexSegment;
+import org.apache.pinot.segment.spi.creator.SegmentGeneratorConfig;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableType;
+import org.apache.pinot.spi.data.FieldSpec.DataType;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.data.readers.GenericRow;
+import org.apache.pinot.spi.utils.BigDecimalUtils;
+import org.apache.pinot.spi.utils.ReadMode;
+import org.apache.pinot.spi.utils.builder.TableConfigBuilder;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+
+
+@SuppressWarnings("rawtypes")
+public class AliasQueriesTest extends BaseQueriesTest {
Review comment:
Moved to OfflineClusterIntegrationTest.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] jtao15 commented on a change in pull request #6891: Allow multiple alias for the same selection column.
Posted by GitBox <gi...@apache.org>.
jtao15 commented on a change in pull request #6891:
URL: https://github.com/apache/incubator-pinot/pull/6891#discussion_r628665006
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/selection/SelectionOperatorUtils.java
##########
@@ -464,21 +464,40 @@ public static SelectionResults renderSelectionResultsWithoutOrdering(List<Object
*
* @param rows selection rows.
* @param dataSchema data schema.
+ * @param selectionColumns selection columns.
* @return {@link ResultTable} object results.
*/
- public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema) {
+ public static ResultTable renderResultTableWithoutOrdering(List<Object[]> rows, DataSchema dataSchema, List<String> selectionColumns) {
Review comment:
Yes, updated.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org