You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ya...@apache.org on 2024/11/28 08:05:17 UTC
(pinot) branch master updated: Adjust RequestUtils#getTableNames to get table names from both left and right sides of join (#14554)
This is an automated email from the ASF dual-hosted git repository.
yashmayya pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 2d470e79e0 Adjust RequestUtils#getTableNames to get table names from both left and right sides of join (#14554)
2d470e79e0 is described below
commit 2d470e79e0cb20d44112cdcbf94db25bc9f5c423
Author: Alex Maniates <ma...@gmail.com>
AuthorDate: Thu Nov 28 03:05:11 2024 -0500
Adjust RequestUtils#getTableNames to get table names from both left and right sides of join (#14554)
---
.../main/java/org/apache/pinot/common/utils/request/RequestUtils.java | 2 +-
.../java/org/apache/pinot/common/utils/request/RequestUtilsTest.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java b/pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java
index 6147b7f7ea..b8c013427d 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java
@@ -614,7 +614,7 @@ public class RequestUtils {
return getTableNames(dataSource.getSubquery());
} else if (dataSource.isSetJoin()) {
return ImmutableSet.<String>builder().addAll(getTableNames(dataSource.getJoin().getLeft()))
- .addAll(getTableNames(dataSource.getJoin().getLeft())).build();
+ .addAll(getTableNames(dataSource.getJoin().getRight())).build();
}
return ImmutableSet.of(dataSource.getTableName());
}
diff --git a/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java b/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java
index bb14d048de..6ca5cf96fd 100644
--- a/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java
+++ b/pinot-common/src/test/java/org/apache/pinot/common/utils/request/RequestUtilsTest.java
@@ -65,7 +65,9 @@ public class RequestUtilsTest {
public Object[][] queryProvider() {
return new Object[][] {
{"select foo from countries where bar > 1", Set.of("countries")},
- {"select 1", null}
+ {"select 1", null},
+ {"SET useMultiStageEngine=true; SELECT table1.foo, table2.bar FROM "
+ + "table1 JOIN table2 ON table1.id = table2.id LIMIT 10;", Set.of("table1", "table2")}
};
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org