Re: [ANNOUNCE] New committer: Stamatis Zampetakis

2019-03-14 Thread Muhammad Gelbana
Congratulations Stamatis :)

Thanks for frequently answering my questions and discussing my raised
topics.

On Fri, Mar 15, 2019, 2:45 AM Michael Mior  wrote:

>  No problem. I'll leave that to you then once the release is done :)
> Thanks!
> --
> Michael Mior
> mm...@apache.org
>
> Le jeu. 14 mars 2019 à 19:03, Stamatis Zampetakis  a
> écrit :
> >
> > Thanks for noticing Michael.
> >
> > Actually, I started doing it at some point but then there were
> > inconsistencies between master, site, and svn, so I decided to do it
> after
> > the release where everything is in line.
> >
> > On Thu, Mar 14, 2019, 10:15 PM Francis Chuang 
> > wrote:
> >
> > > I also noticed Hongze was not added to the community page as well. Once
> > > Kevin releases 1.19.0, we should add both of them to the page.
> > >
> > > On 15/03/2019 2:11 am, Michael Mior wrote:
> > > > I just noticed that Stamatis was never added to the community page
> > > > site. Stamatis, feel free to add yourself once the freeze for the
> > > > current release is over. Otherwise, I'm happy to do so.
> > > > --
> > > > Michael Mior
> > > > mm...@apache.org
> > > >
> > > > Le mer. 30 janv. 2019 à 13:01, Jesus Camacho Rodriguez
> > > >  a écrit :
> > > >>
> > > >> Apache Calcite's Project Management Committee (PMC) has invited
> > > >> Stamatis Zampetakis to become a committer, and we are pleased to
> > > >> announce that he has accepted.
> > > >>
> > > >> Over the past few months, Stamatis has made several contributions to
> > > >> Calcite and he is a very active participant in discussions in issues
> > > >> and mailing lists.
> > > >>
> > > >> Stamatis, welcome, thank you for your contributions, and we look
> > > >> forward your further interactions with the community! If you wish,
> > > >> please feel free to tell us more about yourself and what you are
> > > >> working on.
> > > >>
> > > >> Jesús (on behalf of the Apache Calcite PMC)
> > >
> > >
>


Re: [VOTE] Release apache-calcite-1.19.0 (release candidate 0)

2019-03-14 Thread Julian Hyde
If I was release manager for 1.18, it’s possible that I used ‘mvn’ rather than 
‘./mvnw’. I don’t recall. If so, my bad, I should have updated the release 
instructions.

Julian

On Mar 14, 2019, at 7:22 PM, Kevin Risden  wrote:

>> 
>> maven-wrapper.jar is a binary file, and we cannot have binary files in
>> source distributions. (Note that ./mvnw can bootstrap just fine without it.
>> Also note that it is not checked into git — I guess it is created during
>> the release build process.)
>> 
> 
> Hmmm that is interesting. ./mvnw downloads the
> .mvn/wrapper/maven-wrapper.jar file. The release steps say to use ./mvnw
> (ie: ./mvnw -DskipTests -Papache-release release:perform 2>&1 | tee
> /tmp/perform.log) so not sure if there is something I need to do
> differently or needs to be figured out to ensure the .mvn directory is not
> included in the source distribution.
> 
> Kevin Risden
> 
> 
>> On Thu, Mar 14, 2019 at 8:56 PM Julian Hyde  wrote:
>> 
>> PS Huge thank you to Kevin for being release manager. This has been one of
>> our most complex releases, and I know that Kevin has put in a massive
>> effort to get the release this far. I hope the process is over soon!
>> 
>>> On Mar 14, 2019, at 5:51 PM, Julian Hyde  wrote:
>>> 
>>> -1 due to .mvn/wrapper/maven-wrapper.jar
>>> 
>>> maven-wrapper.jar is a binary file, and we cannot have binary files in
>> source distributions. (Note that ./mvnw can bootstrap just fine without it.
>> Also note that it is not checked into git — I guess it is created during
>> the release build process.)
>>> 
>>> Everything else was fine. Checked hashes, KEYS, LICENSE, NOTICE, README;
>> checked that contents of tar match git; compiled and ran tests using JDK 11
>> on Ubuntu linux.
>>> 
>>> Julian
>>> 
>>> 
 On Mar 14, 2019, at 10:30 AM, Vladimir Sitnikov <
>> sitnikov.vladi...@gmail.com> wrote:
 
 +1 (binding)
 
 Checksum matches, the code compiles.
 Release notes look ok.
 
 Thanks, Kevin
 
 Vladimir
>>> 
>> 
>> 


Re: [VOTE] Release apache-calcite-1.19.0 (release candidate 0)

2019-03-14 Thread Kevin Risden
>
> maven-wrapper.jar is a binary file, and we cannot have binary files in
> source distributions. (Note that ./mvnw can bootstrap just fine without it.
> Also note that it is not checked into git — I guess it is created during
> the release build process.)
>

Hmmm that is interesting. ./mvnw downloads the
.mvn/wrapper/maven-wrapper.jar file. The release steps say to use ./mvnw
(ie: ./mvnw -DskipTests -Papache-release release:perform 2>&1 | tee
/tmp/perform.log) so not sure if there is something I need to do
differently or needs to be figured out to ensure the .mvn directory is not
included in the source distribution.

Kevin Risden


On Thu, Mar 14, 2019 at 8:56 PM Julian Hyde  wrote:

> PS Huge thank you to Kevin for being release manager. This has been one of
> our most complex releases, and I know that Kevin has put in a massive
> effort to get the release this far. I hope the process is over soon!
>
> > On Mar 14, 2019, at 5:51 PM, Julian Hyde  wrote:
> >
> > -1 due to .mvn/wrapper/maven-wrapper.jar
> >
> > maven-wrapper.jar is a binary file, and we cannot have binary files in
> source distributions. (Note that ./mvnw can bootstrap just fine without it.
> Also note that it is not checked into git — I guess it is created during
> the release build process.)
> >
> > Everything else was fine. Checked hashes, KEYS, LICENSE, NOTICE, README;
> checked that contents of tar match git; compiled and ran tests using JDK 11
> on Ubuntu linux.
> >
> > Julian
> >
> >
> >> On Mar 14, 2019, at 10:30 AM, Vladimir Sitnikov <
> sitnikov.vladi...@gmail.com> wrote:
> >>
> >> +1 (binding)
> >>
> >> Checksum matches, the code compiles.
> >> Release notes look ok.
> >>
> >> Thanks, Kevin
> >>
> >> Vladimir
> >
>
>


Re: [VOTE] Release apache-calcite-1.19.0 (release candidate 0)

2019-03-14 Thread Julian Hyde
PS Huge thank you to Kevin for being release manager. This has been one of our 
most complex releases, and I know that Kevin has put in a massive effort to get 
the release this far. I hope the process is over soon!

> On Mar 14, 2019, at 5:51 PM, Julian Hyde  wrote:
> 
> -1 due to .mvn/wrapper/maven-wrapper.jar
> 
> maven-wrapper.jar is a binary file, and we cannot have binary files in source 
> distributions. (Note that ./mvnw can bootstrap just fine without it. Also 
> note that it is not checked into git — I guess it is created during the 
> release build process.)
> 
> Everything else was fine. Checked hashes, KEYS, LICENSE, NOTICE, README; 
> checked that contents of tar match git; compiled and ran tests using JDK 11 
> on Ubuntu linux.
> 
> Julian
> 
> 
>> On Mar 14, 2019, at 10:30 AM, Vladimir Sitnikov 
>>  wrote:
>> 
>> +1 (binding)
>> 
>> Checksum matches, the code compiles.
>> Release notes look ok.
>> 
>> Thanks, Kevin
>> 
>> Vladimir
> 



Re: [VOTE] Release apache-calcite-1.19.0 (release candidate 0)

2019-03-14 Thread Julian Hyde
-1 due to .mvn/wrapper/maven-wrapper.jar

maven-wrapper.jar is a binary file, and we cannot have binary files in source 
distributions. (Note that ./mvnw can bootstrap just fine without it. Also note 
that it is not checked into git — I guess it is created during the release 
build process.)

Everything else was fine. Checked hashes, KEYS, LICENSE, NOTICE, README; 
checked that contents of tar match git; compiled and ran tests using JDK 11 on 
Ubuntu linux.

Julian


> On Mar 14, 2019, at 10:30 AM, Vladimir Sitnikov  
> wrote:
> 
> +1 (binding)
> 
> Checksum matches, the code compiles.
> Release notes look ok.
> 
> Thanks, Kevin
> 
> Vladimir



Re: [ANNOUNCE] New committer: Stamatis Zampetakis

2019-03-14 Thread Michael Mior
 No problem. I'll leave that to you then once the release is done :) Thanks!
--
Michael Mior
mm...@apache.org

Le jeu. 14 mars 2019 à 19:03, Stamatis Zampetakis  a écrit :
>
> Thanks for noticing Michael.
>
> Actually, I started doing it at some point but then there were
> inconsistencies between master, site, and svn, so I decided to do it after
> the release where everything is in line.
>
> On Thu, Mar 14, 2019, 10:15 PM Francis Chuang 
> wrote:
>
> > I also noticed Hongze was not added to the community page as well. Once
> > Kevin releases 1.19.0, we should add both of them to the page.
> >
> > On 15/03/2019 2:11 am, Michael Mior wrote:
> > > I just noticed that Stamatis was never added to the community page
> > > site. Stamatis, feel free to add yourself once the freeze for the
> > > current release is over. Otherwise, I'm happy to do so.
> > > --
> > > Michael Mior
> > > mm...@apache.org
> > >
> > > Le mer. 30 janv. 2019 à 13:01, Jesus Camacho Rodriguez
> > >  a écrit :
> > >>
> > >> Apache Calcite's Project Management Committee (PMC) has invited
> > >> Stamatis Zampetakis to become a committer, and we are pleased to
> > >> announce that he has accepted.
> > >>
> > >> Over the past few months, Stamatis has made several contributions to
> > >> Calcite and he is a very active participant in discussions in issues
> > >> and mailing lists.
> > >>
> > >> Stamatis, welcome, thank you for your contributions, and we look
> > >> forward your further interactions with the community! If you wish,
> > >> please feel free to tell us more about yourself and what you are
> > >> working on.
> > >>
> > >> Jesús (on behalf of the Apache Calcite PMC)
> >
> >


Re: [ANNOUNCE] New committer: Stamatis Zampetakis

2019-03-14 Thread Stamatis Zampetakis
Thanks for noticing Michael.

Actually, I started doing it at some point but then there were
inconsistencies between master, site, and svn, so I decided to do it after
the release where everything is in line.

On Thu, Mar 14, 2019, 10:15 PM Francis Chuang 
wrote:

> I also noticed Hongze was not added to the community page as well. Once
> Kevin releases 1.19.0, we should add both of them to the page.
>
> On 15/03/2019 2:11 am, Michael Mior wrote:
> > I just noticed that Stamatis was never added to the community page
> > site. Stamatis, feel free to add yourself once the freeze for the
> > current release is over. Otherwise, I'm happy to do so.
> > --
> > Michael Mior
> > mm...@apache.org
> >
> > Le mer. 30 janv. 2019 à 13:01, Jesus Camacho Rodriguez
> >  a écrit :
> >>
> >> Apache Calcite's Project Management Committee (PMC) has invited
> >> Stamatis Zampetakis to become a committer, and we are pleased to
> >> announce that he has accepted.
> >>
> >> Over the past few months, Stamatis has made several contributions to
> >> Calcite and he is a very active participant in discussions in issues
> >> and mailing lists.
> >>
> >> Stamatis, welcome, thank you for your contributions, and we look
> >> forward your further interactions with the community! If you wish,
> >> please feel free to tell us more about yourself and what you are
> >> working on.
> >>
> >> Jesús (on behalf of the Apache Calcite PMC)
>
>


Re: Calcite-Master - Build # 1070 - Still Failing

2019-03-14 Thread Stamatis Zampetakis
I introduced this, sorry about that. The warning is present in the script
but apparently I missed it. Will fix it after the release.

Best,
Stamatis

On Thu, Mar 14, 2019, 2:44 AM Julian Hyde  wrote:

> There’s another thing. My build scripts check for deprecation warnings and
> this one has been occurring for a few days.
>
> > [WARNING]
> /home/jhyde/regress/calcite/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java:[238,21]
> convertTo(org.apache.calcite.linq4j.tree.Expression,org.apache.calcite.adapter.enumerable.PhysType)
> in org.apache.calcite.adapter.enumerable.PhysType has been deprecated
>
> Maybe mine is the only script that sees this, but it’s been bugging me.
> I’ll fix it directly after the release.
>
> Julian
>
> > On Mar 12, 2019, at 8:22 PM, Hongze Zhang  wrote:
> >
> > The same problem happens again on a slave node ubuntu-1[1] at time
> 2019-3-12T18:19:10Z, and I am going to wipe out Calcite's workspace of this
> machine.
> >
> > By the way, does anyone know the reason of not including a maven "clean"
> phase before executing "mvn verify" in the Jenkins build configuration?
> >
> >
> > Best,
> > Hongze
> >
> >
> > [1]
> https://builds.apache.org/job/Calcite-Master/jdk=JDK%201.8%20(latest),label_exp=ubuntu&&!cloud-slave&&!H27/
> >
> >
> >
> > -- Original Message --
> > From: "Stamatis Zampetakis" 
> > To: dev@calcite.apache.org
> > Sent: 2019/3/12 0:56:36
> > Subject: Re: Calcite-Master - Build # 1070 - Still Failing
> >
> >> Thanks for looking into this Hongze.
> >>
> >> Unfortunately I am not really familiar with the CI either so I cannot
> >> answer your question.
> >>
> >> In general, I am a bit surprised that there are classes which remain
> from
> >> one build to the other but I guess this is not due to the previous
> commit
> >> but a more general problem.
> >>
> >>
> >>
> >>
> >> On Mon, Mar 11, 2019, 12:16 PM Hongze Zhang  wrote:
> >>
> >>> Hi Stamatis,
> >>>
> >>> I am not much familiar with Calcite's Jenkins CI currently, but I can
> >>> see the reason of the build error is that some cached classes generated
> >>> by old code reference the class SequencedAdderAggregateLambdaFactory
> >>> that has been renamed already.
> >>>
> >>> I have wiped out the workspace on slave nodes H20, H22, H24, now during
> >>> the latest build the error seems went away[1]. But do you or anyone
> know
> >>> a way to clean the workspace on all possible build slave nodes? I am
> not
> >>> sure if what I have done is enough to prevent that the same problem
> >>> occurs again.
> >>>
> >>> Best,
> >>> Hongze
> >>>
> >>>
> >>> [1] https://builds.apache.org/job/Calcite-Master/1072/
> >>>
> >>> -- Original Message --
> >>> From: "Hongze Zhang" 
> >>> To: dev@calcite.apache.org
> >>> Sent: 2019/3/11 17:42:43
> >>> Subject: Re: Calcite-Master - Build # 1070 - Still Failing
> >>>
> >>> >Stamatis,
> >>> >
> >>> >Thank you for reminding me, working on finding a reason.
> >>> >
> >>> >Best,
> >>> >Hongze
> >>> >
> >>> >-- Original Message --
> >>> >From: "Stamatis Zampetakis" 
> >>> >To: dev@calcite.apache.org
> >>> >Sent: 2019/3/11 17:05:12
> >>> >Subject: Re: Calcite-Master - Build # 1070 - Still Failing
> >>> >
> >>> >>Jenkis fails quite often lately and many times with the following
> error:
> >>> >>
> >>> >>java.lang.ClassNotFoundException:
> >>>
> >>>
> >>org.apache.calcite.adapter.enumerable.SequencedAdderAggregateLambdaFactory
> >>> >>
> >>> >>It seems related with the following commit:
> >>> >>
> >>> >>
> >>>
> https://github.com/apache/calcite/commit/f992e6c8fbc3712c6bd70096fb6b05da448b2cab
> >>> >>
> >>> >>where this class was renamed.
> >>> >>
> >>> >>Can you please have a look Hongze Zhang?
> >>> >>
> >>> >>Best,
> >>> >>Stamatis
> >>> >>
> >>> >>
> >>> >>
> >>> >>
> >>> >>Στις Δευ, 11 Μαρ 2019 στις 9:27 π.μ., ο/η Apache Jenkins Server <
> >>> >>jenk...@builds.apache.org> έγραψε:
> >>> >>
> >>> >>>  The Apache Jenkins build system has built Calcite-Master (build
> #1070)
> >>> >>>
> >>> >>>  Status: Still Failing
> >>> >>>
> >>> >>>  Check console output at
> >>> https://builds.apache.org/job/Calcite-Master/1070/
> >>> >>>  to view the results.
> >>> >>
> >>
> >
>
>


Re: [ANNOUNCE] New committer: Stamatis Zampetakis

2019-03-14 Thread Francis Chuang
I also noticed Hongze was not added to the community page as well. Once 
Kevin releases 1.19.0, we should add both of them to the page.


On 15/03/2019 2:11 am, Michael Mior wrote:

I just noticed that Stamatis was never added to the community page
site. Stamatis, feel free to add yourself once the freeze for the
current release is over. Otherwise, I'm happy to do so.
--
Michael Mior
mm...@apache.org

Le mer. 30 janv. 2019 à 13:01, Jesus Camacho Rodriguez
 a écrit :


Apache Calcite's Project Management Committee (PMC) has invited
Stamatis Zampetakis to become a committer, and we are pleased to
announce that he has accepted.

Over the past few months, Stamatis has made several contributions to
Calcite and he is a very active participant in discussions in issues
and mailing lists.

Stamatis, welcome, thank you for your contributions, and we look
forward your further interactions with the community! If you wish,
please feel free to tell us more about yourself and what you are
working on.

Jesús (on behalf of the Apache Calcite PMC)




Re: [VOTE] Release apache-calcite-1.19.0 (release candidate 0)

2019-03-14 Thread Vladimir Sitnikov
+1 (binding)

Checksum matches, the code compiles.
Release notes look ok.

Thanks, Kevin

Vladimir


[VOTE] Release apache-calcite-1.19.0 (release candidate 0)

2019-03-14 Thread Kevin Risden
Hi all,

I have created a build for Apache Calcite 1.19.0, release candidate 0.

Thanks to everyone who has contributed to this release.
You can read the release notes here:
https://github.com/apache/calcite/blob/branch-1.19/site/_docs/history.md

The commit to be voted upon:
https://gitbox.apache.org/repos/asf?p=calcite.git;a=commit;h=a08c36fb0284ad121040c336e7d75001019f3495

Its hash is a08c36fb0284ad121040c336e7d75001019f3495.

The artifacts to be voted on are located here:
https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-1.19.0-rc0/

The hashes of the artifacts are as follows:
src.tar.gz.sha256
a04bfb1bac830e57475dffdbf5f0c3a797c358460d240f6203c929bac61b47ae

A staged Maven repository is available for review at:
https://repository.apache.org/content/repositories/orgapachecalcite-1053/

Release artifacts are signed with the following key:
https://people.apache.org/keys/committer/krisden.asc

Please vote on releasing this package as Apache Calcite 1.19.0.

The vote is open for the next 72 hours and passes if a majority of
at least three +1 PMC votes are cast.

[ ] +1 Release this package as Apache Calcite 1.19.0
[ ]  0 I don't feel strongly about it, but I'm okay with the release
[ ] -1 Do not release this package because...

Here is my vote:
+1 (binding)

Kevin Risden


Re: calcite https://issues.apache.org/jira/browse/CALCITE-759

2019-03-14 Thread Kevin Risden
It looks like you might have worked on this. If you follow the contributing
page it walks through creating a pull request:

https://calcite.apache.org/develop/#contributing

The PR will automatically get linked to the JIRA.

Kevin Risden


On Thu, Mar 14, 2019 at 12:04 PM zxdrmz  wrote:

> Hi All!
>
> I'm working on the TO_TIMESTAMP function implementation. I had added an
> sub-task for this work (https://issues.apache.org/jira/browse/CALCITE-2919
> )
>
> I'm new to Calcite, so I don't expect everything to be done in the right
> way and I will be grateful if someone will take a look.
>
> https://travis-ci.org/Stabmeqt/calcite/builds/501563894 - travis build
> (git
> commit can be found inside)
>
> <
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail
> >
> Без
> вирусов. www.avast.com
> <
> https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=webmail
> >
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>


calcite https://issues.apache.org/jira/browse/CALCITE-759

2019-03-14 Thread zxdrmz
Hi All!

I'm working on the TO_TIMESTAMP function implementation. I had added an
sub-task for this work (https://issues.apache.org/jira/browse/CALCITE-2919)

I'm new to Calcite, so I don't expect everything to be done in the right
way and I will be grateful if someone will take a look.

https://travis-ci.org/Stabmeqt/calcite/builds/501563894 - travis build (git
commit can be found inside)


Без
вирусов. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


Re: [ANNOUNCE] New committer: Stamatis Zampetakis

2019-03-14 Thread Michael Mior
I just noticed that Stamatis was never added to the community page
site. Stamatis, feel free to add yourself once the freeze for the
current release is over. Otherwise, I'm happy to do so.
--
Michael Mior
mm...@apache.org

Le mer. 30 janv. 2019 à 13:01, Jesus Camacho Rodriguez
 a écrit :
>
> Apache Calcite's Project Management Committee (PMC) has invited
> Stamatis Zampetakis to become a committer, and we are pleased to
> announce that he has accepted.
>
> Over the past few months, Stamatis has made several contributions to
> Calcite and he is a very active participant in discussions in issues
> and mailing lists.
>
> Stamatis, welcome, thank you for your contributions, and we look
> forward your further interactions with the community! If you wish,
> please feel free to tell us more about yourself and what you are
> working on.
>
> Jesús (on behalf of the Apache Calcite PMC)


Re: Parantheses in RelBuilder?

2019-03-14 Thread Michael Mior
You don't explicitly create parenthesis. You just need to construct
the conditions in the right order. Just construct the two parts of
your OR separately and then create a new RexCall node with the OR
operator where you pass in each of the two RexNodes you want to
compare.
--
Michael Mior
mm...@apache.org

Le jeu. 14 mars 2019 à 07:56, Rakesh Nair  a écrit :
>
> Hello,
> Would you mind giving me some pointers on *creating parenthesis while
> building a RelNode*.
> For example, how to build RelNode for the sample query:
> SELECT * FROM `persons` WHERE *(*`SALARY` >= 10 AND `SALARY` < 20*)  *OR
> *(*`SALARY` >= 30 AND `SALARY` < 40*)*
>
> P.S. Need to know how to build the parenthesis only, everything else is
> fine..
> --
> Thanks & Regards,
> Rakesh


[jira] [Created] (CALCITE-2921) nullif(null,y) throws exception in verification

2019-03-14 Thread pengzhiwei (JIRA)
pengzhiwei created CALCITE-2921:
---

 Summary: nullif(null,y)  throws exception in verification
 Key: CALCITE-2921
 URL: https://issues.apache.org/jira/browse/CALCITE-2921
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.18.0
Reporter: pengzhiwei
Assignee: pengzhiwei


Currently calcite will translate "nullif(x,y)" to a case-when expression,just 
like "case when x = y then null else x".So when "x" is null literal,a exception 
throws out as follow:
{code:java}
 ELSE clause or at least one THEN clause must be non-NULL
{code}
I have test in mysql,"nullif(null,y) works well.So I think we should allow this 
usage of  "nullif".

There are two ways to fix this issue:

1)  Skip the check for "foundNotNull" in SqlCaseOperator#checkOperandTypes:     
{code:java}
if (!foundNotNull) {
  // according to the sql standard we can not have all of the THEN
  // statements and the ELSE returning null
  if (throwOnFailure) {
throw callBinding.newError(RESOURCE.mustNotNullInElse());
  }
  return false;
}{code}
However, as the comment says, we cannot have all of the THEN and ELSE returning 
null.

2) Add a new SqlOperator like "NullifOperator" and disable the translation from 
nullif to case-when.

Any suggestion is welcomed,Thanks!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Parantheses in RelBuilder?

2019-03-14 Thread Rakesh Nair
Hello,
Would you mind giving me some pointers on *creating parenthesis while
building a RelNode*.
For example, how to build RelNode for the sample query:
SELECT * FROM `persons` WHERE *(*`SALARY` >= 10 AND `SALARY` < 20*)  *OR
*(*`SALARY` >= 30 AND `SALARY` < 40*)*

P.S. Need to know how to build the parenthesis only, everything else is
fine..
-- 
Thanks & Regards,
Rakesh