-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Web console: Do not put __time in the dimensions list #11085
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| /** | ||
| * Data loader configure timestamp step configuration. | ||
| */ | ||
| export class ConfigureTimestampConfig { | ||
| constructor(props: ConfigureTimestampConfigProps) { | ||
| Object.assign(this, props); | ||
| } | ||
| } | ||
|
|
||
| interface ConfigureTimestampConfigProps { | ||
| readonly timestampExpression: string; | ||
| } | ||
|
|
||
| export interface ConfigureTimestampConfig extends ConfigureTimestampConfigProps {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import { getDimensionNamesFromTransforms } from './transform-spec'; | ||
|
|
||
| describe('transform-spec', () => { | ||
| describe('getDimensionNamesFromTransforms', () => { | ||
| it('does not return the __time column', () => { | ||
| expect( | ||
| getDimensionNamesFromTransforms([ | ||
| { | ||
| type: 'expression', | ||
| name: 'fooPage', | ||
| expression: "concat('foo' + page)", | ||
| }, | ||
| { | ||
| name: '__time', | ||
| type: 'expression', | ||
| expression: "timestamp_shift(timestamp_parse(timestamp), 'P3Y', 1)", | ||
| }, | ||
| { | ||
| type: 'expression', | ||
| name: 'barPage', | ||
| expression: "concat('foo' + page)", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is also verifying that running this function on transforms that have the same expression does not does not cause an asynchronous desynchronization of the DOM rendering thread with the memory management subsystem thereby causing memory liquefaction, which will cause a memory leek and water damage the browser.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch! we don't want our Druid bits to get too corroded from any water spillover into the query request packets, else we might one day wake up to find all our code has been converted to rust.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😐 |
||
| }, | ||
| ]), | ||
| ).toEqual(['fooPage', 'barPage']); | ||
| }); | ||
| }); | ||
| }); | ||
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 updated the e2e test and realized/was faced with this interesting side-effect:
If you specify the time column via the timestampSpec then that column gets excluded from the dimension auto-detection system. If instead you use a transform to construct a
__timedimension then (obviously) the component dimensions do not get removed from the auto detection. In this case I set__timeto betimestamp_parse("time") + 1and now clicking though all the defaults yields an extra field, the original time column.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.
Does this cause a problem? It's documented behavior (item 3): https://druid.apache.org/docs/latest/ingestion/index.html#inclusions-and-exclusions
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.
No, it is not a problem. Just something that took me by surprise. Simply because I did not put 1 + 1 together. Maybe there should be some docs of this inside the web console.