-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pulsar SQL] Make the Pulsar SQL support query the uppercase topic #9980
[Pulsar SQL] Make the Pulsar SQL support query the uppercase topic #9980
Conversation
/pulsarbot run-failure-checks |
private static final Logger log = Logger.get(PulsarMetadata.class); | ||
|
||
private final LoadingCache<SchemaTableName, TopicName> tableNameTopicNameCache = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the static
is necessary, this class is a singleton class, and if changing this field to static, the corresponding methods and field should be changed to static.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
/pulsarbot run-failure-checks |
Remove the release/2.7.2 tag since this is not a serious problem and branch-2.7 does not contain PIP-71, there are lots of conflicts when cherry-picking this one. |
Motivation
When querying the uppercase topic (e.g.
public/default/case_UPPER_topic
) by the Pulsar SQL, it will throw the error "topic not found" because of the classSchemaTableName
, in the Pulsar SQL, we couldn't get the exact table name (e.g.Test
,tEst
) but only lowercase table name (e.g.test
), this is the presto behavior.Refer to the presto class
SchemaTableName
.If there are topics
public/default/case_UPPER_topic
,public/default/case_upper_topic
, the queryshow tables in pulsar."public/default"
will return one resultpublic/default/case_upper_topic
, this behavior is determined by the presto spi.There is a precondition for querying the uppercase topic, the topic name must be unique. For example, if there are topics
public/default/case_UPPER_topic
,public/default/case_upper_topic
, the queryselect * from pulsar."public/default"."case_upper_topic" will throw error no matched topic, because of that we could get the exact topic by the lowercase table name
case_upper_topic`.If there is a unique topic
public/default/case_UPPER_topic
, the queryselect * from pulsar."public/default"."case_UPPER_topic
orselect * from pulsar."public/default"."case_upper_topic
will query that unique topic.Modifications
Get the matched topic by the lowercase table name in the method
getTableHandle
.Verifying this change
Add new integration tests.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changes