You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by Priyanka Gugale <pr...@apache.org> on 2016/07/20 10:06:03 UTC

Using DSL api to construct sql queries

Hi,

Malhar JDBC operator does lots of string manipulation and other handling to
construct sql queries as per user inputs. Instead of constructing queries
on our own we should use some dsl api library which will let us write DB
agnostic code and take care of all other complexities.

I am trying out JOOQ library to write sql query in
AbstractJdbcPollInputOperator. Would like to hear about communities
feedback and suggestions.

-Priyanka

Re: Using DSL api to construct sql queries

Posted by Priyanka Gugale <pr...@datatorrent.com>.
Thanks for your input Justin.
We did use JOOQ runtime only.

-Priyanka

On Thu, Sep 29, 2016 at 11:16 AM, Justin Mclean <ju...@classsoftware.com>
wrote:

> Hi,
>
> A little late here but form a quick look it should be OK.
>
> The jOOQ runtime (which I assume is the bit you want to use) is Apache
> licensed and what it depends is compatible.
>
> You could not bundle the jOOQ-meta-extensions in source or binary release
> as it depends on Category B license (MPL) which only only be bundled in a
> convenience binary.
>
>  More importantly it contains Hibernate  which CategoryX LGPL licensed
> which can’t be a dependancy.
>
> Likewise jOOQ-checker could not be included due to GPL licensed component.
>
> Thanks,
> Justin

Re: Using DSL api to construct sql queries

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

A little late here but form a quick look it should be OK.

The jOOQ runtime (which I assume is the bit you want to use) is Apache licensed and what it depends is compatible.

You could not bundle the jOOQ-meta-extensions in source or binary release as it depends on Category B license (MPL) which only only be bundled in a convenience binary.

 More importantly it contains Hibernate  which CategoryX LGPL licensed which can’t be a dependancy. 

Likewise jOOQ-checker could not be included due to GPL licensed component.

Thanks,
Justin

Re: Using DSL api to construct sql queries

Posted by Priyanka Gugale <pr...@datatorrent.com>.
Hi,

Does anyone has inputs on licensing part? I will start a new mail thread to
discuss that issue separately.

-Priyanka

On Fri, Jul 22, 2016 at 11:58 PM, Pradeep A. Dalvi <pr...@apache.org> wrote:

> +1 From what I read, this change is completely backword compatible.
>
> --prad
>
> On Thu, Jul 21, 2016 at 11:13 PM, Chinmay Kolhatkar <
> chinmay@datatorrent.com
> > wrote:
>
> > Yes there is no clash with calcite integration. Calcite is a query
> planner
> > converts SQL to a relational algebra... This is different.
> >
> > On Fri, Jul 22, 2016 at 11:03 AM, Priyanka Gugale <pr...@apache.org>
> > wrote:
> >
> > > I don't know much about Calcite, but reading abstract, calcite seems to
> > be
> > > for different purpose. What I want to achieve here is some library
> which
> > > will let me construct sql query without worrying about different DB
> > > platforms. The library will take care of converting query to the DB
> > > specific syntax. I am focusing on query construction only and not
> > planning
> > > or execution.
> > >
> > > -Priyanka
> > >
> > > On Thu, Jul 21, 2016 at 9:58 PM, Siyuan Hua <si...@datatorrent.com>
> > > wrote:
> > >
> > > > But is it a duplication of integration with Calcite?
> > > >
> > > > On Thu, Jul 21, 2016 at 9:26 AM, Timothy Farkas <
> > > > timothytiborfarkas@gmail.com> wrote:
> > > >
> > > > > I see, cool :)
> > > > >
> > > > > On Thu, Jul 21, 2016 at 9:21 AM, Priyanka Gugale <
> priyag@apache.org>
> > > > > wrote:
> > > > >
> > > > > > Hi Tim,
> > > > > >
> > > > > > We are not creating our own DSL, the jooq is just another query
> > > > > > parser/builder like JsqlParser. I am trying to use one of these
> > query
> > > > DSL
> > > > > > libraries to replace the existing code in operator which is
> written
> > > to
> > > > > > construct the queries.
> > > > > >
> > > > > > -Priyanka
> > > > > >
> > > > > > On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
> > > > > > timothytiborfarkas@gmail.com> wrote:
> > > > > >
> > > > > > > I don't know the exact context here so please forgive me if I'm
> > > > > > mistaken. I
> > > > > > > don't think creating our own DSL is the way to go. Creating a
> > > generic
> > > > > DSL
> > > > > > > is hard. We should support setting the flavor of SQL being used
> > as
> > > a
> > > > > > > property and then allow standard sql to be specified. There are
> > > > already
> > > > > > > mature Apache License SQL parsers which support many different
> > SQL
> > > > > > > implementations.
> > > > > > >
> > > > > > > https://github.com/JSQLParser/JSqlParser
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Tim
> > > > > > >
> > > > > > > On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <
> > > priyag@apache.org>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Looking closely at licensing, it says it *depends but doesn't
> > > > bundle*
> > > > > > > those
> > > > > > > > non ASL license dependencies. As per my understanding those
> > will
> > > be
> > > > > > > > included only if we explicitly include them using our
> > application
> > > > > pom.
> > > > > > > > Right away we are not using any of those features which
> depend
> > of
> > > > > such
> > > > > > > > third party licenses.
> > > > > > > >
> > > > > > > > Anyone have any suggestion over including this library?
> > > > > > > >
> > > > > > > > Dev,
> > > > > > > > Yes querydsl is an option, but jooq seems more promising. If
> > > there
> > > > we
> > > > > > see
> > > > > > > > license is a problem then may be we can go to querydsl.
> > > > > > > >
> > > > > > > > -Priyanka
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > > > > > > > devendrat@datatorrent.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > +1 for using DSL constructs that are vendor agnostic.
> > > > > > > > >
> > > > > > > > > Checkout https://github.com/querydsl/querydsl (Apache
> > > licensed)
> > > > as
> > > > > > > well
> > > > > > > > > in-case it fits better in terms of implementation.
> > > > > > > > >
> > > > > > > > > Also, once the DSL work is done, please test and document
> the
> > > > > > behavior
> > > > > > > > > (exactly once, at-least once ..)the operator has with
> > different
> > > > > > > > databases.
> > > > > > > > >
> > > > > > > > > Thanks,
> > > > > > > > > Dev
> > > > > > > > >
> > > > > > > > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <
> > > > > bhupesh@apache.org>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > It is a good idea to get rid of vendor specific
> > > implementation
> > > > > > > > > differences
> > > > > > > > > > for SQL.
> > > > > > > > > >
> > > > > > > > > > However, the licensing does not seem to be
> straightforward.
> > > > > Please
> > > > > > > > check:
> > > > > > > > > > http://www.jooq.org/legal/licensing. Can this be used
> as a
> > > > > > > dependency
> > > > > > > > in
> > > > > > > > > > Apex?
> > > > > > > > > >
> > > > > > > > > > ~ Bhupesh
> > > > > > > > > >
> > > > > > > > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <
> > > > > > priyag@apache.org>
> > > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > Hi,
> > > > > > > > > > >
> > > > > > > > > > > Malhar JDBC operator does lots of string manipulation
> and
> > > > other
> > > > > > > > > handling
> > > > > > > > > > to
> > > > > > > > > > > construct sql queries as per user inputs. Instead of
> > > > > constructing
> > > > > > > > > queries
> > > > > > > > > > > on our own we should use some dsl api library which
> will
> > > let
> > > > us
> > > > > > > write
> > > > > > > > > DB
> > > > > > > > > > > agnostic code and take care of all other complexities.
> > > > > > > > > > >
> > > > > > > > > > > I am trying out JOOQ library to write sql query in
> > > > > > > > > > > AbstractJdbcPollInputOperator. Would like to hear about
> > > > > > communities
> > > > > > > > > > > feedback and suggestions.
> > > > > > > > > > >
> > > > > > > > > > > -Priyanka
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by "Pradeep A. Dalvi" <pr...@apache.org>.
+1 From what I read, this change is completely backword compatible.

--prad

On Thu, Jul 21, 2016 at 11:13 PM, Chinmay Kolhatkar <chinmay@datatorrent.com
> wrote:

> Yes there is no clash with calcite integration. Calcite is a query planner
> converts SQL to a relational algebra... This is different.
>
> On Fri, Jul 22, 2016 at 11:03 AM, Priyanka Gugale <pr...@apache.org>
> wrote:
>
> > I don't know much about Calcite, but reading abstract, calcite seems to
> be
> > for different purpose. What I want to achieve here is some library which
> > will let me construct sql query without worrying about different DB
> > platforms. The library will take care of converting query to the DB
> > specific syntax. I am focusing on query construction only and not
> planning
> > or execution.
> >
> > -Priyanka
> >
> > On Thu, Jul 21, 2016 at 9:58 PM, Siyuan Hua <si...@datatorrent.com>
> > wrote:
> >
> > > But is it a duplication of integration with Calcite?
> > >
> > > On Thu, Jul 21, 2016 at 9:26 AM, Timothy Farkas <
> > > timothytiborfarkas@gmail.com> wrote:
> > >
> > > > I see, cool :)
> > > >
> > > > On Thu, Jul 21, 2016 at 9:21 AM, Priyanka Gugale <pr...@apache.org>
> > > > wrote:
> > > >
> > > > > Hi Tim,
> > > > >
> > > > > We are not creating our own DSL, the jooq is just another query
> > > > > parser/builder like JsqlParser. I am trying to use one of these
> query
> > > DSL
> > > > > libraries to replace the existing code in operator which is written
> > to
> > > > > construct the queries.
> > > > >
> > > > > -Priyanka
> > > > >
> > > > > On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
> > > > > timothytiborfarkas@gmail.com> wrote:
> > > > >
> > > > > > I don't know the exact context here so please forgive me if I'm
> > > > > mistaken. I
> > > > > > don't think creating our own DSL is the way to go. Creating a
> > generic
> > > > DSL
> > > > > > is hard. We should support setting the flavor of SQL being used
> as
> > a
> > > > > > property and then allow standard sql to be specified. There are
> > > already
> > > > > > mature Apache License SQL parsers which support many different
> SQL
> > > > > > implementations.
> > > > > >
> > > > > > https://github.com/JSQLParser/JSqlParser
> > > > > >
> > > > > > Thanks,
> > > > > > Tim
> > > > > >
> > > > > > On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <
> > priyag@apache.org>
> > > > > > wrote:
> > > > > >
> > > > > > > Looking closely at licensing, it says it *depends but doesn't
> > > bundle*
> > > > > > those
> > > > > > > non ASL license dependencies. As per my understanding those
> will
> > be
> > > > > > > included only if we explicitly include them using our
> application
> > > > pom.
> > > > > > > Right away we are not using any of those features which depend
> of
> > > > such
> > > > > > > third party licenses.
> > > > > > >
> > > > > > > Anyone have any suggestion over including this library?
> > > > > > >
> > > > > > > Dev,
> > > > > > > Yes querydsl is an option, but jooq seems more promising. If
> > there
> > > we
> > > > > see
> > > > > > > license is a problem then may be we can go to querydsl.
> > > > > > >
> > > > > > > -Priyanka
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > > > > > > devendrat@datatorrent.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > +1 for using DSL constructs that are vendor agnostic.
> > > > > > > >
> > > > > > > > Checkout https://github.com/querydsl/querydsl (Apache
> > licensed)
> > > as
> > > > > > well
> > > > > > > > in-case it fits better in terms of implementation.
> > > > > > > >
> > > > > > > > Also, once the DSL work is done, please test and document the
> > > > > behavior
> > > > > > > > (exactly once, at-least once ..)the operator has with
> different
> > > > > > > databases.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Dev
> > > > > > > >
> > > > > > > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <
> > > > bhupesh@apache.org>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > It is a good idea to get rid of vendor specific
> > implementation
> > > > > > > > differences
> > > > > > > > > for SQL.
> > > > > > > > >
> > > > > > > > > However, the licensing does not seem to be straightforward.
> > > > Please
> > > > > > > check:
> > > > > > > > > http://www.jooq.org/legal/licensing. Can this be used as a
> > > > > > dependency
> > > > > > > in
> > > > > > > > > Apex?
> > > > > > > > >
> > > > > > > > > ~ Bhupesh
> > > > > > > > >
> > > > > > > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <
> > > > > priyag@apache.org>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > Malhar JDBC operator does lots of string manipulation and
> > > other
> > > > > > > > handling
> > > > > > > > > to
> > > > > > > > > > construct sql queries as per user inputs. Instead of
> > > > constructing
> > > > > > > > queries
> > > > > > > > > > on our own we should use some dsl api library which will
> > let
> > > us
> > > > > > write
> > > > > > > > DB
> > > > > > > > > > agnostic code and take care of all other complexities.
> > > > > > > > > >
> > > > > > > > > > I am trying out JOOQ library to write sql query in
> > > > > > > > > > AbstractJdbcPollInputOperator. Would like to hear about
> > > > > communities
> > > > > > > > > > feedback and suggestions.
> > > > > > > > > >
> > > > > > > > > > -Priyanka
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Chinmay Kolhatkar <ch...@datatorrent.com>.
Yes there is no clash with calcite integration. Calcite is a query planner
converts SQL to a relational algebra... This is different.

On Fri, Jul 22, 2016 at 11:03 AM, Priyanka Gugale <pr...@apache.org> wrote:

> I don't know much about Calcite, but reading abstract, calcite seems to be
> for different purpose. What I want to achieve here is some library which
> will let me construct sql query without worrying about different DB
> platforms. The library will take care of converting query to the DB
> specific syntax. I am focusing on query construction only and not planning
> or execution.
>
> -Priyanka
>
> On Thu, Jul 21, 2016 at 9:58 PM, Siyuan Hua <si...@datatorrent.com>
> wrote:
>
> > But is it a duplication of integration with Calcite?
> >
> > On Thu, Jul 21, 2016 at 9:26 AM, Timothy Farkas <
> > timothytiborfarkas@gmail.com> wrote:
> >
> > > I see, cool :)
> > >
> > > On Thu, Jul 21, 2016 at 9:21 AM, Priyanka Gugale <pr...@apache.org>
> > > wrote:
> > >
> > > > Hi Tim,
> > > >
> > > > We are not creating our own DSL, the jooq is just another query
> > > > parser/builder like JsqlParser. I am trying to use one of these query
> > DSL
> > > > libraries to replace the existing code in operator which is written
> to
> > > > construct the queries.
> > > >
> > > > -Priyanka
> > > >
> > > > On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
> > > > timothytiborfarkas@gmail.com> wrote:
> > > >
> > > > > I don't know the exact context here so please forgive me if I'm
> > > > mistaken. I
> > > > > don't think creating our own DSL is the way to go. Creating a
> generic
> > > DSL
> > > > > is hard. We should support setting the flavor of SQL being used as
> a
> > > > > property and then allow standard sql to be specified. There are
> > already
> > > > > mature Apache License SQL parsers which support many different SQL
> > > > > implementations.
> > > > >
> > > > > https://github.com/JSQLParser/JSqlParser
> > > > >
> > > > > Thanks,
> > > > > Tim
> > > > >
> > > > > On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <
> priyag@apache.org>
> > > > > wrote:
> > > > >
> > > > > > Looking closely at licensing, it says it *depends but doesn't
> > bundle*
> > > > > those
> > > > > > non ASL license dependencies. As per my understanding those will
> be
> > > > > > included only if we explicitly include them using our application
> > > pom.
> > > > > > Right away we are not using any of those features which depend of
> > > such
> > > > > > third party licenses.
> > > > > >
> > > > > > Anyone have any suggestion over including this library?
> > > > > >
> > > > > > Dev,
> > > > > > Yes querydsl is an option, but jooq seems more promising. If
> there
> > we
> > > > see
> > > > > > license is a problem then may be we can go to querydsl.
> > > > > >
> > > > > > -Priyanka
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > > > > > devendrat@datatorrent.com>
> > > > > > wrote:
> > > > > >
> > > > > > > +1 for using DSL constructs that are vendor agnostic.
> > > > > > >
> > > > > > > Checkout https://github.com/querydsl/querydsl (Apache
> licensed)
> > as
> > > > > well
> > > > > > > in-case it fits better in terms of implementation.
> > > > > > >
> > > > > > > Also, once the DSL work is done, please test and document the
> > > > behavior
> > > > > > > (exactly once, at-least once ..)the operator has with different
> > > > > > databases.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Dev
> > > > > > >
> > > > > > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <
> > > bhupesh@apache.org>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > It is a good idea to get rid of vendor specific
> implementation
> > > > > > > differences
> > > > > > > > for SQL.
> > > > > > > >
> > > > > > > > However, the licensing does not seem to be straightforward.
> > > Please
> > > > > > check:
> > > > > > > > http://www.jooq.org/legal/licensing. Can this be used as a
> > > > > dependency
> > > > > > in
> > > > > > > > Apex?
> > > > > > > >
> > > > > > > > ~ Bhupesh
> > > > > > > >
> > > > > > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <
> > > > priyag@apache.org>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > Malhar JDBC operator does lots of string manipulation and
> > other
> > > > > > > handling
> > > > > > > > to
> > > > > > > > > construct sql queries as per user inputs. Instead of
> > > constructing
> > > > > > > queries
> > > > > > > > > on our own we should use some dsl api library which will
> let
> > us
> > > > > write
> > > > > > > DB
> > > > > > > > > agnostic code and take care of all other complexities.
> > > > > > > > >
> > > > > > > > > I am trying out JOOQ library to write sql query in
> > > > > > > > > AbstractJdbcPollInputOperator. Would like to hear about
> > > > communities
> > > > > > > > > feedback and suggestions.
> > > > > > > > >
> > > > > > > > > -Priyanka
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Priyanka Gugale <pr...@apache.org>.
I don't know much about Calcite, but reading abstract, calcite seems to be
for different purpose. What I want to achieve here is some library which
will let me construct sql query without worrying about different DB
platforms. The library will take care of converting query to the DB
specific syntax. I am focusing on query construction only and not planning
or execution.

-Priyanka

On Thu, Jul 21, 2016 at 9:58 PM, Siyuan Hua <si...@datatorrent.com> wrote:

> But is it a duplication of integration with Calcite?
>
> On Thu, Jul 21, 2016 at 9:26 AM, Timothy Farkas <
> timothytiborfarkas@gmail.com> wrote:
>
> > I see, cool :)
> >
> > On Thu, Jul 21, 2016 at 9:21 AM, Priyanka Gugale <pr...@apache.org>
> > wrote:
> >
> > > Hi Tim,
> > >
> > > We are not creating our own DSL, the jooq is just another query
> > > parser/builder like JsqlParser. I am trying to use one of these query
> DSL
> > > libraries to replace the existing code in operator which is written to
> > > construct the queries.
> > >
> > > -Priyanka
> > >
> > > On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
> > > timothytiborfarkas@gmail.com> wrote:
> > >
> > > > I don't know the exact context here so please forgive me if I'm
> > > mistaken. I
> > > > don't think creating our own DSL is the way to go. Creating a generic
> > DSL
> > > > is hard. We should support setting the flavor of SQL being used as a
> > > > property and then allow standard sql to be specified. There are
> already
> > > > mature Apache License SQL parsers which support many different SQL
> > > > implementations.
> > > >
> > > > https://github.com/JSQLParser/JSqlParser
> > > >
> > > > Thanks,
> > > > Tim
> > > >
> > > > On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <pr...@apache.org>
> > > > wrote:
> > > >
> > > > > Looking closely at licensing, it says it *depends but doesn't
> bundle*
> > > > those
> > > > > non ASL license dependencies. As per my understanding those will be
> > > > > included only if we explicitly include them using our application
> > pom.
> > > > > Right away we are not using any of those features which depend of
> > such
> > > > > third party licenses.
> > > > >
> > > > > Anyone have any suggestion over including this library?
> > > > >
> > > > > Dev,
> > > > > Yes querydsl is an option, but jooq seems more promising. If there
> we
> > > see
> > > > > license is a problem then may be we can go to querydsl.
> > > > >
> > > > > -Priyanka
> > > > >
> > > > >
> > > > >
> > > > > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > > > > devendrat@datatorrent.com>
> > > > > wrote:
> > > > >
> > > > > > +1 for using DSL constructs that are vendor agnostic.
> > > > > >
> > > > > > Checkout https://github.com/querydsl/querydsl (Apache licensed)
> as
> > > > well
> > > > > > in-case it fits better in terms of implementation.
> > > > > >
> > > > > > Also, once the DSL work is done, please test and document the
> > > behavior
> > > > > > (exactly once, at-least once ..)the operator has with different
> > > > > databases.
> > > > > >
> > > > > > Thanks,
> > > > > > Dev
> > > > > >
> > > > > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <
> > bhupesh@apache.org>
> > > > > > wrote:
> > > > > >
> > > > > > > It is a good idea to get rid of vendor specific implementation
> > > > > > differences
> > > > > > > for SQL.
> > > > > > >
> > > > > > > However, the licensing does not seem to be straightforward.
> > Please
> > > > > check:
> > > > > > > http://www.jooq.org/legal/licensing. Can this be used as a
> > > > dependency
> > > > > in
> > > > > > > Apex?
> > > > > > >
> > > > > > > ~ Bhupesh
> > > > > > >
> > > > > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <
> > > priyag@apache.org>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Malhar JDBC operator does lots of string manipulation and
> other
> > > > > > handling
> > > > > > > to
> > > > > > > > construct sql queries as per user inputs. Instead of
> > constructing
> > > > > > queries
> > > > > > > > on our own we should use some dsl api library which will let
> us
> > > > write
> > > > > > DB
> > > > > > > > agnostic code and take care of all other complexities.
> > > > > > > >
> > > > > > > > I am trying out JOOQ library to write sql query in
> > > > > > > > AbstractJdbcPollInputOperator. Would like to hear about
> > > communities
> > > > > > > > feedback and suggestions.
> > > > > > > >
> > > > > > > > -Priyanka
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Siyuan Hua <si...@datatorrent.com>.
But is it a duplication of integration with Calcite?

On Thu, Jul 21, 2016 at 9:26 AM, Timothy Farkas <
timothytiborfarkas@gmail.com> wrote:

> I see, cool :)
>
> On Thu, Jul 21, 2016 at 9:21 AM, Priyanka Gugale <pr...@apache.org>
> wrote:
>
> > Hi Tim,
> >
> > We are not creating our own DSL, the jooq is just another query
> > parser/builder like JsqlParser. I am trying to use one of these query DSL
> > libraries to replace the existing code in operator which is written to
> > construct the queries.
> >
> > -Priyanka
> >
> > On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
> > timothytiborfarkas@gmail.com> wrote:
> >
> > > I don't know the exact context here so please forgive me if I'm
> > mistaken. I
> > > don't think creating our own DSL is the way to go. Creating a generic
> DSL
> > > is hard. We should support setting the flavor of SQL being used as a
> > > property and then allow standard sql to be specified. There are already
> > > mature Apache License SQL parsers which support many different SQL
> > > implementations.
> > >
> > > https://github.com/JSQLParser/JSqlParser
> > >
> > > Thanks,
> > > Tim
> > >
> > > On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <pr...@apache.org>
> > > wrote:
> > >
> > > > Looking closely at licensing, it says it *depends but doesn't bundle*
> > > those
> > > > non ASL license dependencies. As per my understanding those will be
> > > > included only if we explicitly include them using our application
> pom.
> > > > Right away we are not using any of those features which depend of
> such
> > > > third party licenses.
> > > >
> > > > Anyone have any suggestion over including this library?
> > > >
> > > > Dev,
> > > > Yes querydsl is an option, but jooq seems more promising. If there we
> > see
> > > > license is a problem then may be we can go to querydsl.
> > > >
> > > > -Priyanka
> > > >
> > > >
> > > >
> > > > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > > > devendrat@datatorrent.com>
> > > > wrote:
> > > >
> > > > > +1 for using DSL constructs that are vendor agnostic.
> > > > >
> > > > > Checkout https://github.com/querydsl/querydsl (Apache licensed) as
> > > well
> > > > > in-case it fits better in terms of implementation.
> > > > >
> > > > > Also, once the DSL work is done, please test and document the
> > behavior
> > > > > (exactly once, at-least once ..)the operator has with different
> > > > databases.
> > > > >
> > > > > Thanks,
> > > > > Dev
> > > > >
> > > > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <
> bhupesh@apache.org>
> > > > > wrote:
> > > > >
> > > > > > It is a good idea to get rid of vendor specific implementation
> > > > > differences
> > > > > > for SQL.
> > > > > >
> > > > > > However, the licensing does not seem to be straightforward.
> Please
> > > > check:
> > > > > > http://www.jooq.org/legal/licensing. Can this be used as a
> > > dependency
> > > > in
> > > > > > Apex?
> > > > > >
> > > > > > ~ Bhupesh
> > > > > >
> > > > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <
> > priyag@apache.org>
> > > > > > wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Malhar JDBC operator does lots of string manipulation and other
> > > > > handling
> > > > > > to
> > > > > > > construct sql queries as per user inputs. Instead of
> constructing
> > > > > queries
> > > > > > > on our own we should use some dsl api library which will let us
> > > write
> > > > > DB
> > > > > > > agnostic code and take care of all other complexities.
> > > > > > >
> > > > > > > I am trying out JOOQ library to write sql query in
> > > > > > > AbstractJdbcPollInputOperator. Would like to hear about
> > communities
> > > > > > > feedback and suggestions.
> > > > > > >
> > > > > > > -Priyanka
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Timothy Farkas <ti...@gmail.com>.
I see, cool :)

On Thu, Jul 21, 2016 at 9:21 AM, Priyanka Gugale <pr...@apache.org> wrote:

> Hi Tim,
>
> We are not creating our own DSL, the jooq is just another query
> parser/builder like JsqlParser. I am trying to use one of these query DSL
> libraries to replace the existing code in operator which is written to
> construct the queries.
>
> -Priyanka
>
> On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
> timothytiborfarkas@gmail.com> wrote:
>
> > I don't know the exact context here so please forgive me if I'm
> mistaken. I
> > don't think creating our own DSL is the way to go. Creating a generic DSL
> > is hard. We should support setting the flavor of SQL being used as a
> > property and then allow standard sql to be specified. There are already
> > mature Apache License SQL parsers which support many different SQL
> > implementations.
> >
> > https://github.com/JSQLParser/JSqlParser
> >
> > Thanks,
> > Tim
> >
> > On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <pr...@apache.org>
> > wrote:
> >
> > > Looking closely at licensing, it says it *depends but doesn't bundle*
> > those
> > > non ASL license dependencies. As per my understanding those will be
> > > included only if we explicitly include them using our application pom.
> > > Right away we are not using any of those features which depend of such
> > > third party licenses.
> > >
> > > Anyone have any suggestion over including this library?
> > >
> > > Dev,
> > > Yes querydsl is an option, but jooq seems more promising. If there we
> see
> > > license is a problem then may be we can go to querydsl.
> > >
> > > -Priyanka
> > >
> > >
> > >
> > > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > > devendrat@datatorrent.com>
> > > wrote:
> > >
> > > > +1 for using DSL constructs that are vendor agnostic.
> > > >
> > > > Checkout https://github.com/querydsl/querydsl (Apache licensed) as
> > well
> > > > in-case it fits better in terms of implementation.
> > > >
> > > > Also, once the DSL work is done, please test and document the
> behavior
> > > > (exactly once, at-least once ..)the operator has with different
> > > databases.
> > > >
> > > > Thanks,
> > > > Dev
> > > >
> > > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <bh...@apache.org>
> > > > wrote:
> > > >
> > > > > It is a good idea to get rid of vendor specific implementation
> > > > differences
> > > > > for SQL.
> > > > >
> > > > > However, the licensing does not seem to be straightforward. Please
> > > check:
> > > > > http://www.jooq.org/legal/licensing. Can this be used as a
> > dependency
> > > in
> > > > > Apex?
> > > > >
> > > > > ~ Bhupesh
> > > > >
> > > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <
> priyag@apache.org>
> > > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Malhar JDBC operator does lots of string manipulation and other
> > > > handling
> > > > > to
> > > > > > construct sql queries as per user inputs. Instead of constructing
> > > > queries
> > > > > > on our own we should use some dsl api library which will let us
> > write
> > > > DB
> > > > > > agnostic code and take care of all other complexities.
> > > > > >
> > > > > > I am trying out JOOQ library to write sql query in
> > > > > > AbstractJdbcPollInputOperator. Would like to hear about
> communities
> > > > > > feedback and suggestions.
> > > > > >
> > > > > > -Priyanka
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Priyanka Gugale <pr...@apache.org>.
Hi Tim,

We are not creating our own DSL, the jooq is just another query
parser/builder like JsqlParser. I am trying to use one of these query DSL
libraries to replace the existing code in operator which is written to
construct the queries.

-Priyanka

On Thu, Jul 21, 2016 at 9:42 PM, Timothy Farkas <
timothytiborfarkas@gmail.com> wrote:

> I don't know the exact context here so please forgive me if I'm mistaken. I
> don't think creating our own DSL is the way to go. Creating a generic DSL
> is hard. We should support setting the flavor of SQL being used as a
> property and then allow standard sql to be specified. There are already
> mature Apache License SQL parsers which support many different SQL
> implementations.
>
> https://github.com/JSQLParser/JSqlParser
>
> Thanks,
> Tim
>
> On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <pr...@apache.org>
> wrote:
>
> > Looking closely at licensing, it says it *depends but doesn't bundle*
> those
> > non ASL license dependencies. As per my understanding those will be
> > included only if we explicitly include them using our application pom.
> > Right away we are not using any of those features which depend of such
> > third party licenses.
> >
> > Anyone have any suggestion over including this library?
> >
> > Dev,
> > Yes querydsl is an option, but jooq seems more promising. If there we see
> > license is a problem then may be we can go to querydsl.
> >
> > -Priyanka
> >
> >
> >
> > On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> > devendrat@datatorrent.com>
> > wrote:
> >
> > > +1 for using DSL constructs that are vendor agnostic.
> > >
> > > Checkout https://github.com/querydsl/querydsl (Apache licensed) as
> well
> > > in-case it fits better in terms of implementation.
> > >
> > > Also, once the DSL work is done, please test and document the behavior
> > > (exactly once, at-least once ..)the operator has with different
> > databases.
> > >
> > > Thanks,
> > > Dev
> > >
> > > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <bh...@apache.org>
> > > wrote:
> > >
> > > > It is a good idea to get rid of vendor specific implementation
> > > differences
> > > > for SQL.
> > > >
> > > > However, the licensing does not seem to be straightforward. Please
> > check:
> > > > http://www.jooq.org/legal/licensing. Can this be used as a
> dependency
> > in
> > > > Apex?
> > > >
> > > > ~ Bhupesh
> > > >
> > > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <pr...@apache.org>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Malhar JDBC operator does lots of string manipulation and other
> > > handling
> > > > to
> > > > > construct sql queries as per user inputs. Instead of constructing
> > > queries
> > > > > on our own we should use some dsl api library which will let us
> write
> > > DB
> > > > > agnostic code and take care of all other complexities.
> > > > >
> > > > > I am trying out JOOQ library to write sql query in
> > > > > AbstractJdbcPollInputOperator. Would like to hear about communities
> > > > > feedback and suggestions.
> > > > >
> > > > > -Priyanka
> > > > >
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Timothy Farkas <ti...@gmail.com>.
I don't know the exact context here so please forgive me if I'm mistaken. I
don't think creating our own DSL is the way to go. Creating a generic DSL
is hard. We should support setting the flavor of SQL being used as a
property and then allow standard sql to be specified. There are already
mature Apache License SQL parsers which support many different SQL
implementations.

https://github.com/JSQLParser/JSqlParser

Thanks,
Tim

On Thu, Jul 21, 2016 at 2:19 AM, Priyanka Gugale <pr...@apache.org> wrote:

> Looking closely at licensing, it says it *depends but doesn't bundle* those
> non ASL license dependencies. As per my understanding those will be
> included only if we explicitly include them using our application pom.
> Right away we are not using any of those features which depend of such
> third party licenses.
>
> Anyone have any suggestion over including this library?
>
> Dev,
> Yes querydsl is an option, but jooq seems more promising. If there we see
> license is a problem then may be we can go to querydsl.
>
> -Priyanka
>
>
>
> On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <
> devendrat@datatorrent.com>
> wrote:
>
> > +1 for using DSL constructs that are vendor agnostic.
> >
> > Checkout https://github.com/querydsl/querydsl (Apache licensed) as well
> > in-case it fits better in terms of implementation.
> >
> > Also, once the DSL work is done, please test and document the behavior
> > (exactly once, at-least once ..)the operator has with different
> databases.
> >
> > Thanks,
> > Dev
> >
> > On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <bh...@apache.org>
> > wrote:
> >
> > > It is a good idea to get rid of vendor specific implementation
> > differences
> > > for SQL.
> > >
> > > However, the licensing does not seem to be straightforward. Please
> check:
> > > http://www.jooq.org/legal/licensing. Can this be used as a dependency
> in
> > > Apex?
> > >
> > > ~ Bhupesh
> > >
> > > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <pr...@apache.org>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > Malhar JDBC operator does lots of string manipulation and other
> > handling
> > > to
> > > > construct sql queries as per user inputs. Instead of constructing
> > queries
> > > > on our own we should use some dsl api library which will let us write
> > DB
> > > > agnostic code and take care of all other complexities.
> > > >
> > > > I am trying out JOOQ library to write sql query in
> > > > AbstractJdbcPollInputOperator. Would like to hear about communities
> > > > feedback and suggestions.
> > > >
> > > > -Priyanka
> > > >
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Priyanka Gugale <pr...@apache.org>.
Looking closely at licensing, it says it *depends but doesn't bundle* those
non ASL license dependencies. As per my understanding those will be
included only if we explicitly include them using our application pom.
Right away we are not using any of those features which depend of such
third party licenses.

Anyone have any suggestion over including this library?

Dev,
Yes querydsl is an option, but jooq seems more promising. If there we see
license is a problem then may be we can go to querydsl.

-Priyanka



On Wed, Jul 20, 2016 at 8:58 PM, Devendra Tagare <de...@datatorrent.com>
wrote:

> +1 for using DSL constructs that are vendor agnostic.
>
> Checkout https://github.com/querydsl/querydsl (Apache licensed) as well
> in-case it fits better in terms of implementation.
>
> Also, once the DSL work is done, please test and document the behavior
> (exactly once, at-least once ..)the operator has with different databases.
>
> Thanks,
> Dev
>
> On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <bh...@apache.org>
> wrote:
>
> > It is a good idea to get rid of vendor specific implementation
> differences
> > for SQL.
> >
> > However, the licensing does not seem to be straightforward. Please check:
> > http://www.jooq.org/legal/licensing. Can this be used as a dependency in
> > Apex?
> >
> > ~ Bhupesh
> >
> > On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <pr...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > Malhar JDBC operator does lots of string manipulation and other
> handling
> > to
> > > construct sql queries as per user inputs. Instead of constructing
> queries
> > > on our own we should use some dsl api library which will let us write
> DB
> > > agnostic code and take care of all other complexities.
> > >
> > > I am trying out JOOQ library to write sql query in
> > > AbstractJdbcPollInputOperator. Would like to hear about communities
> > > feedback and suggestions.
> > >
> > > -Priyanka
> > >
> >
>

Re: Using DSL api to construct sql queries

Posted by Devendra Tagare <de...@datatorrent.com>.
+1 for using DSL constructs that are vendor agnostic.

Checkout https://github.com/querydsl/querydsl (Apache licensed) as well
in-case it fits better in terms of implementation.

Also, once the DSL work is done, please test and document the behavior
(exactly once, at-least once ..)the operator has with different databases.

Thanks,
Dev

On Wed, Jul 20, 2016 at 4:04 AM, Bhupesh Chawda <bh...@apache.org> wrote:

> It is a good idea to get rid of vendor specific implementation differences
> for SQL.
>
> However, the licensing does not seem to be straightforward. Please check:
> http://www.jooq.org/legal/licensing. Can this be used as a dependency in
> Apex?
>
> ~ Bhupesh
>
> On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <pr...@apache.org>
> wrote:
>
> > Hi,
> >
> > Malhar JDBC operator does lots of string manipulation and other handling
> to
> > construct sql queries as per user inputs. Instead of constructing queries
> > on our own we should use some dsl api library which will let us write DB
> > agnostic code and take care of all other complexities.
> >
> > I am trying out JOOQ library to write sql query in
> > AbstractJdbcPollInputOperator. Would like to hear about communities
> > feedback and suggestions.
> >
> > -Priyanka
> >
>

Re: Using DSL api to construct sql queries

Posted by Bhupesh Chawda <bh...@apache.org>.
It is a good idea to get rid of vendor specific implementation differences
for SQL.

However, the licensing does not seem to be straightforward. Please check:
http://www.jooq.org/legal/licensing. Can this be used as a dependency in
Apex?

~ Bhupesh

On Wed, Jul 20, 2016 at 3:06 AM, Priyanka Gugale <pr...@apache.org> wrote:

> Hi,
>
> Malhar JDBC operator does lots of string manipulation and other handling to
> construct sql queries as per user inputs. Instead of constructing queries
> on our own we should use some dsl api library which will let us write DB
> agnostic code and take care of all other complexities.
>
> I am trying out JOOQ library to write sql query in
> AbstractJdbcPollInputOperator. Would like to hear about communities
> feedback and suggestions.
>
> -Priyanka
>