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 2022/08/21 23:44:09 UTC
[GitHub] [pinot] tanmesh opened a new pull request, #9263: parsing query to get tablename
tanmesh opened a new pull request, #9263:
URL: https://github.com/apache/pinot/pull/9263
Description:
This PR extract tableName from the query when the tableName is null.
This PR will solve the following issue -- #8842
Testing:
Added the ConnectionTest.java to ensure that the tableName is parsed correctly.
--
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: commits-unsubscribe@pinot.apache.org
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
Re: [PR] parsing query to get tablename [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1762061561
#9902 of the same purpose was merged
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] Jackie-Jiang commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r952969869
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,29 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
Review Comment:
```suggestion
@Nullable
public String getTableNameFromQuery(String query) {
```
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,29 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (PinotClientException e) {
+ LOGGER.error("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
Review Comment:
We don't want to log an error here because this is most likely a bad query. Suggest not logging because user can get the `PinotClientException`
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,29 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (PinotClientException e) {
+ LOGGER.error("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
+ }
+
+ if(pinotQuery.getDataSource() != null) {
Review Comment:
(code format) Please reformat the code with [Pinot Style](https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup?q=pinot+style#intellij)
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,29 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (PinotClientException e) {
Review Comment:
```suggestion
} catch (Exception e) {
```
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1248692420
Putting the error message for reference.
> Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project pinot-jdbc-client: Compilation failure
Error: /home/runner/work/pinot/pinot/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotPreparedStatementTest.java:[41,73] error: constructor DummyPinotControllerTransport in class DummyPinotControllerTransport cannot be applied to given types;
Error: required: Map<String,String>,String,SSLContext
Error: found: no arguments
Error: reason: actual and formal argument lists differ in length
It's giving compilation error on CI test, though it is successful on local testing.
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r952030273
##########
pinot-clients/pinot-java-client/src/test/java/org/apache/pinot/client/ConnectionTest.java:
##########
@@ -0,0 +1,27 @@
+package org.apache.pinot.client;
Review Comment:
Thanks!
--
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: commits-unsubscribe@pinot.apache.org
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
Re: [PR] parsing query to get tablename [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang closed pull request #9263: parsing query to get tablename
URL: https://github.com/apache/pinot/pull/9263
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] Jackie-Jiang commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1229051810
Here are the failed tests, not sure if they are related:
```
2022-08-23T22:43:39.6255697Z [ERROR] Failures:
2022-08-23T22:43:39.6286446Z [ERROR] ResultSetGroupTest.testDeserializeAggregationGroupByResultSet:89->getResultSet:133 » PinotClient
2022-08-23T22:43:39.6287809Z [ERROR] ResultSetGroupTest.testDeserializeAggregationResultSet:67->getResultSet:133 » PinotClient
2022-08-23T22:43:39.6288737Z [ERROR] ResultSetGroupTest.testDeserializeExceptionResultSetSkipFail:126 Execute should have thrown an exception
2022-08-23T22:43:39.6290158Z [ERROR] ResultSetGroupTest.testDeserializeSelectionResultSet:40->getResultSet:133 » PinotClient
```
I'll rerun the tests anyway
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r952042753
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
+ }
+
+ DataSource dataSource;
+
+ try {
+ dataSource = pinotQuery.getDataSource();
+ } catch (Exception e) {
+ throw new PinotClientException("Caught exception while extracting DataSource from PinotQuery. DataSource is null.");
+ }
+
+ String tableName = dataSource.getTableName();
+
+ if(tableName == null) {
Review Comment:
Thanks for the suggestion! I have fixed this and added the appropriate test for this scenario.
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r952030910
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
Review Comment:
Thanks for pointing this!!
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1228953285
@Jackie-Jiang May I get some help with this? I am unable to understand why these two Unit Test Sets are failing?
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] xiangfu0 commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
xiangfu0 commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r951989041
##########
pinot-clients/pinot-java-client/src/test/java/org/apache/pinot/client/ConnectionTest.java:
##########
@@ -0,0 +1,27 @@
+package org.apache.pinot.client;
Review Comment:
add license header.
You can run `mvn license:format -T1C`
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1248389714
I have addressed the failures in the latest commit. @Jackie-Jiang can you plz review and re-run the CI test ?
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] xiangfu0 commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
xiangfu0 commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1257726960
> @Jackie-Jiang Can you please **re-run the CI**? because the `pinot-jdbc-client` (which is failing in CI ) is successful in local testing.
Seems re-run doesn't pass
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1257527037
@Jackie-Jiang Can you please **re-run the CI**? because the `pinot-jdbc-client` (which is failing in CI ) is successful in local testing.
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r953079985
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,29 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (PinotClientException e) {
+ LOGGER.error("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
+ }
+
+ if(pinotQuery.getDataSource() != null) {
Review Comment:
I have reformat the code with Pinot Style. Please lmk if it looks fine.
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] codecov-commenter commented on pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #9263:
URL: https://github.com/apache/pinot/pull/9263#issuecomment-1224954198
# [Codecov](https://codecov.io/gh/apache/pinot/pull/9263?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 [#9263](https://codecov.io/gh/apache/pinot/pull/9263?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (61df979) into [master](https://codecov.io/gh/apache/pinot/commit/7197461f29e9799e179997828a436076f1b0a130?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7197461) will **increase** coverage by `29.98%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #9263 +/- ##
=============================================
+ Coverage 37.14% 67.13% +29.98%
- Complexity 193 4817 +4624
=============================================
Files 1838 1381 -457
Lines 97516 71991 -25525
Branches 14711 11524 -3187
=============================================
+ Hits 36222 48329 +12107
+ Misses 58360 20157 -38203
- Partials 2934 3505 +571
```
| Flag | Coverage Δ | |
|---|---|---|
| integration1 | `?` | |
| integration2 | `?` | |
| unittests1 | `67.13% <ø> (?)` | |
| unittests2 | `?` | |
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/pinot/pull/9263?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...va/org/apache/pinot/core/routing/RoutingTable.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9yb3V0aW5nL1JvdXRpbmdUYWJsZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...va/org/apache/pinot/common/config/NettyConfig.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vY29uZmlnL05ldHR5Q29uZmlnLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...a/org/apache/pinot/common/metrics/MinionMeter.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...g/apache/pinot/common/metrics/ControllerMeter.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Db250cm9sbGVyTWV0ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/pinot/pull/9263/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%)` | :arrow_down: |
| [.../apache/pinot/common/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...ache/pinot/server/access/AccessControlFactory.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VydmVyL2FjY2Vzcy9BY2Nlc3NDb250cm9sRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...a/org/apache/pinot/query/parser/QueryRewriter.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtcXVlcnktcGxhbm5lci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcGFyc2VyL1F1ZXJ5UmV3cml0ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...he/pinot/common/messages/SegmentReloadMessage.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWVzc2FnZXMvU2VnbWVudFJlbG9hZE1lc3NhZ2UuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...he/pinot/common/messages/TableDeletionMessage.java](https://codecov.io/gh/apache/pinot/pull/9263/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-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWVzc2FnZXMvVGFibGVEZWxldGlvbk1lc3NhZ2UuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [1598 more](https://codecov.io/gh/apache/pinot/pull/9263/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) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
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] [pinot] xiangfu0 commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
xiangfu0 commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r951989943
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
Review Comment:
Add e to the PinotClientException.
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
+ }
+
+ DataSource dataSource;
+
+ try {
+ dataSource = pinotQuery.getDataSource();
+ } catch (Exception e) {
+ throw new PinotClientException("Caught exception while extracting DataSource from PinotQuery. DataSource is null.");
+ }
+
+ String tableName = dataSource.getTableName();
+
+ if(tableName == null) {
Review Comment:
If tableName is null, then return null.
I'm thinking of the case like `select 1` which is a valid SQL and should be executed by any pinot broker.
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
Review Comment:
LOGGER.error
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
+ }
+
+ DataSource dataSource;
+
+ try {
+ dataSource = pinotQuery.getDataSource();
Review Comment:
When this will throw an exception?
--
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: commits-unsubscribe@pinot.apache.org
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] [pinot] tanmesh commented on a diff in pull request #9263: parsing query to get tablename
Posted by GitBox <gi...@apache.org>.
tanmesh commented on code in PR #9263:
URL: https://github.com/apache/pinot/pull/9263#discussion_r952042392
##########
pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java:
##########
@@ -105,6 +108,38 @@ public ResultSetGroup execute(Request request)
return execute(null, request);
}
+ /**
+ * Extract tableName from the given query
+ * @param query
+ * @return tableName
+ * @throws PinotClientException
+ */
+ public String getTableNameFromQuery(String query) {
+ PinotQuery pinotQuery;
+
+ try {
+ pinotQuery = CalciteSqlParser.compileToPinotQuery(query);
+ } catch (Exception e) {
+ LOGGER.info("Caught exception while compiling SQL request: {}, {}", query, e.getMessage());
+ throw new PinotClientException("Caught exception while compiling SQL request");
+ }
+
+ DataSource dataSource;
+
+ try {
+ dataSource = pinotQuery.getDataSource();
Review Comment:
Thanks for pointing this out. It was actually not throwing the exception.
--
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: commits-unsubscribe@pinot.apache.org
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