Skip to content
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

SQL: Fix JDBC url pattern in docs and error message #56612

Merged
merged 3 commits into from
May 13, 2020

Conversation

matriv
Copy link
Contributor

@matriv matriv commented May 12, 2020

The docs pattern url was using * which means zero or many instead
of ? which means zero or one. The pattern url returned in error
messages was not in sync with the one in the docs.

Fixes: #56476

The docs pattern url was using `*` which means zero or many instead
of `?` which means zero or one. The pattern url returned in error
messages was not in sync with the one in the docs.

Fixes: elastic#56476
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (:Query Languages/SQL)

@elasticmachine elasticmachine added the Team:QL (Deprecated) Meta label for query languages team label May 12, 2020
@@ -51,7 +51,7 @@ Once registered, the driver understands the following syntax as an URL:

["source","text",subs="attributes"]
----
jdbc:es://[[http|https]://]*[host[:port]]*/[prefix]*<[?[option=value]&]*
jdbc:es://[[http|https]://]?[host[:port]]?/[prefix]?[?[option=value]&]*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

? means zero ore one in regex, which is what we want, but how can we differentiate from the [?[option...] which is the actual char ? ? In the error message I used \?, but not sure. Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

For 0 or 1 (or ?) there is also the {0,1} more explicit notation, but I am not sure if we want to complicate things...

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM

@matriv matriv merged commit 1a5945c into elastic:master May 13, 2020
@matriv matriv deleted the fix-56476 branch May 13, 2020 10:12
matriv added a commit that referenced this pull request May 13, 2020
The docs pattern url was using `*` which means zero or many instead
of `?` which means zero or one. The pattern url returned in error
messages was not in sync with the one in the docs.

Fixes: #56476
(cherry picked from commit 1a5945c)
matriv added a commit that referenced this pull request May 13, 2020
The docs pattern url was using `*` which means zero or many instead
of `?` which means zero or one. The pattern url returned in error
messages was not in sync with the one in the docs.

Fixes: #56476
(cherry picked from commit 1a5945c)
matriv added a commit that referenced this pull request May 13, 2020
The docs pattern url was using `*` which means zero or many instead
of `?` which means zero or one. The pattern url returned in error
messages was not in sync with the one in the docs.

Fixes: #56476
(cherry picked from commit 1a5945c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL: the invalid url error message should be in line with the documentation
5 participants