Skip to content

Fix rewrite of queryPath for encoded joda intervals as query param on druid router#5274

Merged
nishantmonu51 merged 3 commits intoapache:masterfrom
nishantmonu51:fix-encoding
Jan 23, 2018
Merged

Fix rewrite of queryPath for encoded joda intervals as query param on druid router#5274
nishantmonu51 merged 3 commits intoapache:masterfrom
nishantmonu51:fix-encoding

Conversation

@nishantmonu51
Copy link
Copy Markdown
Member

@nishantmonu51 nishantmonu51 commented Jan 19, 2018

Issue - when we send joda interval with timezone as an encoded interval is is not reWritten properly on the router.

Steps to reproduce -

Send a get request to following URL and try to fetch candidates to query- 
http://<router-host>:<port>/druid/v2/datasources/somedatasource/candidates?intervals=1900-01-01T00
%3A00%3A00.000%2B01%3A00%2F3000-01-01T00%3A00%3A00.000%2B01%3A00

Note - the parameter is encoded using URLEncoder and works fine when we hit the broker directly.

Exception of stack trace -

java.lang.IllegalArgumentException: Invalid format: "1900-01-01T00:00:00.000 00:09:21" is malformed at " 00:09:21"
        at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:945) ~[joda-time-2.9.9.jar:2.9.
9]
        at org.joda.time.convert.StringConverter.setInto(StringConverter.java:212) ~[joda-time-2.9.9.jar:2.9.9]
        at org.joda.time.base.BaseInterval.<init>(BaseInterval.java:200) ~[joda-time-2.9.9.jar:2.9.9]
        at org.joda.time.Interval.<init>(Interval.java:270) ~[joda-time-2.9.9.jar:2.9.9]
        at org.joda.time.Interval.parse(Interval.java:75) ~[joda-time-2.9.9.jar:2.9.9]
        at io.druid.server.ClientInfoResource.getQueryTargets(ClientInfoResource.java:320) ~[druid-server-0.10.1.2.6.3
.0-235.jar:0.10.1.2.6.3.0-235]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-s
erver-1.19.3.jar:1.19.3]

Copy link
Copy Markdown
Member

@leventov leventov left a comment

Choose a reason for hiding this comment

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

Please fix checkstyle

@nishantmonu51
Copy link
Copy Markdown
Member Author

done.

Copy link
Copy Markdown
Contributor

@jihoonson jihoonson left a comment

Choose a reason for hiding this comment

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

Please fix the comment.

);

// Test reWrite Encoded interval with timezone info
// decoded parameters -> intervals=1900-01-01T00:00:00.000+01.00/3000-01-01T00:00:00.000+01:00")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1900-01-01T00:00:00.000+01.00 -> 1900-01-01T00:00:00.000+01:00

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

@gianm gianm added this to the 0.12.0 milestone Jan 23, 2018
@nishantmonu51 nishantmonu51 merged commit aca200f into apache:master Jan 23, 2018
nishantmonu51 added a commit to nishantmonu51/druid that referenced this pull request Jan 23, 2018
… druid router (apache#5274)

* Fix rewrite of queryPath for encoded joda intervals as query param on druid router

* fix checkstyle

* fix comment
himanshug pushed a commit that referenced this pull request Jan 23, 2018
… druid router (#5274) (#5285)

* Fix rewrite of queryPath for encoded joda intervals as query param on druid router

* fix checkstyle

* fix comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants