Skip to content

Allow Pinot to accept query with FROM clause in the format of [database].[table]#5707

Merged
xiangfu0 merged 3 commits intomasterfrom
support_catalog_in_from_clause
Jul 16, 2020
Merged

Allow Pinot to accept query with FROM clause in the format of [database].[table]#5707
xiangfu0 merged 3 commits intomasterfrom
support_catalog_in_from_clause

Conversation

@xiangfu0
Copy link
Contributor

@xiangfu0 xiangfu0 commented Jul 15, 2020

Description

Allow Pinot to accept query with FROM clause in the format of [database].[table].
Will update TableName to [table] in BrokerRequest, when [database].[table] doesn't exist but [table] exists.

For case sensitive mode (default), use RoutingManager to check table existence.
For case insensitive mode, use TableCache to check table existence.

Some thoughts here:
We should try to prevent user creating table with dot in the table name.

Release Notes

Allow Pinot to accept query with FROM clause in the format of [database].[table].

*
* @param brokerRequest
*/
private void updateQuerySource(BrokerRequest brokerRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done in PinotQuery2BrokerRequestConverter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I could do that!

Here we don't have any information of existing table names as we are allowing dot in table name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I feel that we should introduce the concept that no dot is allowed in table name/column name.
I'm not sure if anyone is using dot in table name, but it's definitely some users are using dot in column name.

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

…ler/BaseBrokerRequestHandler.java

Co-authored-by: Xiaotian (Jackie) Jiang <17555551+Jackie-Jiang@users.noreply.github.com>
@xiangfu0 xiangfu0 merged commit 48d9ca7 into master Jul 16, 2020
@xiangfu0 xiangfu0 deleted the support_catalog_in_from_clause branch July 16, 2020 07:18
@xiangfu0 xiangfu0 linked an issue Jul 23, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disallow dot in table name and column name.

3 participants