Opened 8 years ago

Closed 6 years ago

#3068 closed enhancement (wontfix)

Raise a warning/error when where parameter is not correctly set

Reported by: veroandreo Owned by: grass-dev@…
Priority: normal Milestone: 7.4.1
Component: Temporal Version: svn-trunk
Keywords: where Cc:
CPU: Unspecified Platform: Linux

Description

I have a set of 16 years of MODIS data starting on February 18, 2000. My intention was to aggregate data seasonally (3 months granularity), but as start is shifted, I wanted aggregation to start from April 1st. This was my command:

t.rast.aggregate --o input=${var}_${tile} method=average \
output=${var}_${tile}_seasonal_average \
basename=${var}_${tile}_seasonal_average \
suffix=gran where="start_time >= 2000-04-01 00:00:00" \
granularity="3 months"

I forgot to write 'single quotes' around the date. Therefore, the where parameter was ignored and all my seasons shifted and I had to run all over again.

Would that be possible to check if the where clause is "well-written" and raise an error/warning if it is not??

Thanks so much in advance!

ps: I guess I will double check for single quotes tons of times from now on

Change History (5)

in reply to:  description ; comment:1 by mlennert, 8 years ago

Replying to veroandreo:

I have a set of 16 years of MODIS data starting on February 18, 2000. My intention was to aggregate data seasonally (3 months granularity), but as start is shifted, I wanted aggregation to start from April 1st. This was my command:

t.rast.aggregate --o input=${var}_${tile} method=average \
output=${var}_${tile}_seasonal_average \
basename=${var}_${tile}_seasonal_average \
suffix=gran where="start_time >= 2000-04-01 00:00:00" \
granularity="3 months"

I forgot to write 'single quotes' around the date. Therefore, the where parameter was ignored and all my seasons shifted and I had to run all over again.

Would that be possible to check if the where clause is "well-written" and raise an error/warning if it is not??

The problem will be to define "well-written". AFAIK, the "check" is currently done by the db backend: if it accepts the formulation, then ok, if not, you'll see an error.

So apparently your backend considers your where clause as being correct in terms of syntax. And we won't be able to create and intelligent system that will be able to tell whether what you write is actually what you mean... ;-)

So, for me, this is a wonfix.

in reply to:  1 comment:2 by veroandreo, 8 years ago

Replying to mlennert:

Replying to veroandreo:

I have a set of 16 years of MODIS data starting on February 18, 2000. My intention was to aggregate data seasonally (3 months granularity), but as start is shifted, I wanted aggregation to start from April 1st. This was my command:

t.rast.aggregate --o input=${var}_${tile} method=average \
output=${var}_${tile}_seasonal_average \
basename=${var}_${tile}_seasonal_average \
suffix=gran where="start_time >= 2000-04-01 00:00:00" \
granularity="3 months"

I forgot to write 'single quotes' around the date. Therefore, the where parameter was ignored and all my seasons shifted and I had to run all over again.

Would that be possible to check if the where clause is "well-written" and raise an error/warning if it is not??

The problem will be to define "well-written". AFAIK, the "check" is currently done by the db backend: if it accepts the formulation, then ok, if not, you'll see an error.

I see... but according to the definition in the manual, this where is in the temporal framework, so I imagined it could be something like if there's start_date or end_date in the left hand side, then check for single quotes around the right hand part of the expression... maybe too complicated...

So apparently your backend considers your where clause as being correct in terms of syntax.

So, it is an SQLite issue, that is not sensitive to that kind of mistakes?

And we won't be able to create and intelligent system that will be able to tell whether what you write is actually what you mean... ;-)

meep! :)

comment:3 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:4 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:5 by veroandreo, 6 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.