Query Parameter Checking for Stats Queries should move from QE to OpServer

Bug #1602130 reported by Anish Mehta
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
High
Nikhil Bansal

Bug Description

After we move Stats schema's out of viz.sandesh, QE will not have access to Stats Schema.
We should add Query Parameter checking to OpServer:

code from StatsSelect::StatsSelect() in QE:

            if (main_query->stats().is_stat_table_static()) {
                if (agg != QEOpServerProxy::COUNT) {
                    StatsQuery::column_t c = main_query->stats().get_column_desc(sfield);
                    if (sfield == g_viz_constants.STAT_TIME_FIELD) {
                        if (ts_period_ || isTBC_) {
                            QE_TRACE(DEBUG, "StatsSelect cannot aggregate " <<
                                sfield << "with T=");
                        }
                        isTC_ = true;
                    } else if (sfield == g_viz_constants.STAT_TIMEBIN_FIELD) {
                        if (isT_ || isTC_) {
                            QE_TRACE(DEBUG, "StatsSelect cannot aggregate " <<
                                sfield << " with T");
                        }
                        isTBC_ = true;
                    } else if (c.datatype == QEOpServerProxy::BLANK) {
                        QE_TRACE(DEBUG, "StatsSelect unknown field " << select_fields_[j]);
                        return;
                    }
                } else {
                    if (sfield != main_query->stats().attr()) {
                        QE_TRACE(DEBUG,"StatsSelect Invalid COUNT field " << sfield);
                        return;
                    }
                }
            }

Tags: analytics
Raj Reddy (rajreddy)
Changed in juniperopenstack:
importance: Undecided → High
assignee: nobody → Nikhil Bansal (nikhilb-u)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/22535
Submitter: Nikhil Bansal (<email address hidden>)

information type: Proprietary → Public
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/22535
Committed: http://github.org/Juniper/contrail-controller/commit/5019cad90723de1aebd1bbc9d4313e37923da27f
Submitter: Zuul
Branch: master

commit 5019cad90723de1aebd1bbc9d4313e37923da27f
Author: Nikhil B <email address hidden>
Date: Thu Jul 28 11:31:40 2016 +0530

move parameter validation for stats queries from QE to opserver

Now, with stats table schema removed from viz.sandesh, it is no longer
available to QE for parameter validation. These parameter validation steps
should instead be done in Opserver now.
Closes-Bug:1602130

Change-Id: I8d7eaa8fa9faa45de62715a6d002e0e6981fca9a

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.