google-code-export / stoqs

Automatically exported from code.google.com/p/stoqs
GNU General Public License v3.0
1 stars 1 forks source link

Parameter Value query on Sampled Parameter not working #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open a STOQS database that contains Sampled Parameters, e.g.: 
http://odss.mbari.org/canon/stoqs_simz_aug2013/query/
2. Select Platform Dorado, select MP fl700_uncorr for Parameter-Parameter X and 
SP B1006_barnacles for Parameter-Parameter Y. A Parameter-Paramter correlation 
plot appears.
3. Now check "All Parameters" in Parameter Values and select a range above the 
OD threshold value for B1006_barnacles, e.g. 0.1 to 0.17.

What is the expected output? What do you see instead?

Expected to see a modified Parameter-Parameter plot, but get error message 
instead: No data returned from query  Try a different selection.

The sql tab in Parameter-Parameter shows:

SELECT DISTINCT stoqs_measurement.depth,
                mp_x.datavalue AS x,
                sp_y.datavalue AS y
FROM stoqs_activity
INNER JOIN stoqs_platform ON stoqs_platform.id = stoqs_activity.platform_id
INNER JOIN stoqs_instantpoint ON stoqs_instantpoint.activity_id = 
stoqs_activity.id
INNER JOIN stoqs_measurement ON stoqs_measurement.instantpoint_id = 
stoqs_instantpoint.id
INNER JOIN stoqs_sample ON stoqs_sample.instantpoint_id = stoqs_instantpoint.id
INNER JOIN stoqs_sample s_y ON s_y.instantpoint_id = stoqs_instantpoint.id
INNER JOIN stoqs_sampledparameter sp_y ON sp_y.sample_id = s_y.id
INNER JOIN stoqs_parameter p_y ON sp_y.parameter_id = p_y.id
INNER JOIN stoqs_measurement m_x ON m_x.instantpoint_id = stoqs_instantpoint.id
INNER JOIN stoqs_measuredparameter mp_x ON mp_x.measurement_id = m_x.id
INNER JOIN stoqs_parameter p_x ON mp_x.parameter_id = p_x.id
INNER JOIN stoqs_measurement m1 ON m1.instantpoint_id = stoqs_instantpoint.id
INNER JOIN stoqs_measuredparameter mp1 ON mp1.measurement_id = m1.id
INNER JOIN stoqs_parameter p1 ON mp1.parameter_id = p1.id
WHERE (p1.name = 'B1006_barnacles')
  AND (mp1.datavalue > 0.1003)
  AND (mp1.datavalue < 0.1640)
  AND (mp1.parameter_id = p1.id)
  AND (p_y.id = 38)
  AND (p_x.id = 8)
  AND (p1.name = 'B1006_barnacles')
  AND (mp1.datavalue > 0.1003)
  AND (mp1.datavalue < 0.1640)
  AND (mp1.parameter_id = p1.id)
  AND stoqs_platform.name IN ('dorado')

It looks like the SQL generation is broken for MP to SP Parameter-Parameter 
comparisons.

Original issue reported on code.google.com by MBARIm...@gmail.com on 1 May 2014 at 6:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 2416fdb68d5c.

Original comment by MBARIm...@gmail.com on 6 May 2014 at 11:21

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 2416fdb68d5c.

Original comment by MBARIm...@gmail.com on 21 Sep 2014 at 9:04