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

Add virtual columns support. #86

Merged
merged 2 commits into from
Aug 10, 2019
Merged

Conversation

vchimishuk
Copy link
Contributor

Hi,
We use Druidry in our company and faced lack of virtual columns (http:https://druid.io/docs/latest/querying/virtual-columns.html). Here is a simple patch which adds virtual columns support.

Usage example:

        DruidGroupByQuery.DruidGroupByQueryBuilder query = DruidGroupByQuery
                .builder()
                .dataSource("druidDatasource")
                .granularity(new SimpleGranularity(PredefinedGranularity.ALL))
                .dimensions(Arrays.asList(new SimpleDimension("size")))
                .intervals(Collections.singletonList(interval))
                .virtualColumns(Collections.singletonList(new ExpressionVirtualColumn("size",
                        "concat(width, ':', height)", OutputType.STRING)));

Result:

{version=v1, timestamp=2019-02-15T00:00:00.000Z, event={size=160:600}}
{version=v1, timestamp=2019-02-15T00:00:00.000Z, event={size=80:80}}

@abhi-zapr
Copy link
Contributor

Is there any list of what all druid query supports virtual columns ? Or all the druid query supports virtual columns ?
In later case, if possible, can you also apply virtual column patch in other queries ?

And thanks for contributing.

@vchimishuk
Copy link
Contributor Author

@abhi-zapr, added one more commit with requested changes. Also added virtual columns support for other query types.
Sorry, for delay.

@abhi-zapr abhi-zapr requested a review from GG-Zapr March 16, 2019 19:46
@vchimishuk
Copy link
Contributor Author

Hi, @abhi-zapr. Is there any plans to include it into new release any time soon?

@abhi-zapr
Copy link
Contributor

Hey @vchimishuk
We will include you patch in next release, hopefully by the end of the next week.
Thanks.

@vchimishuk
Copy link
Contributor Author

Thank you for the update, @abhi-zapr.

@vchimishuk
Copy link
Contributor Author

Hi, guys.
Any progress on releasing this PR?

@vchimishuk
Copy link
Contributor Author

@abhi-zapr, @GG-Zapr, any update on the issue?

@abhi-zapr
Copy link
Contributor

abhi-zapr commented Jul 8, 2019

Hey @vchimishuk
Sorry for the delay, we are having Tech Conference this week at our organization and we are really busy in that. We haven't released any new version yet, otherwise would have included your patch. We will try to merge and release next week.

@vchimishuk
Copy link
Contributor Author

@abhi-zapr, thank you.

@abhi-zapr abhi-zapr merged commit 301b063 into zapr-oss:develop Aug 10, 2019
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.

None yet

3 participants