Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Query "Operator" does not seem to be included in the Generated SQL

  1. #1
    Join Date
    Sep 2006
    Posts
    11

    Default Query "Operator" does not seem to be included in the Generated SQL

    Query "Operator" does not seem to be included in the Generated SQL.

    Please confirm.


    A workaroung is to include the Operator e.g "=, <, >, is null" in the Condition

    For Example Condition ( = 'Value' )
    Last edited by cruel_world; 01-04-2007 at 01:42 PM.

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default Expression builder

    Actually, one of the feature requests you see the least, but what is really needed IMHO, is the creation of an expression builder to allow for more complex expressions for both calculated fields AND where clauses.
    It's no easy feat and something that should be as thought-out as possible as it needs to cater to SQL dialects, reporting engines AND OLAP cubes. Not just that, it needs to support localization and be human readeable too. (you should be able to see the business column names, not just the IDs)
    The current stuff is lame, but it was intended to be just a placeholder for the expression builders.
    Whatever the case, once Kettle-2.4.0 is out of the way a bit, I'll be working on that too.

  3. #3
    Join Date
    Sep 2006
    Posts
    11

    Default

    Funny enough, I understand, I just got through 3 years of building an Ad-Hoc BI system for the DOD. Fortunitly it was limited to Oracle, However i would have exploded if I needed to wright for Multiple DBs.

  4. #4
    Join Date
    Jan 2007
    Posts
    3

    Default Looks like all constraints get mangled up

    Was looking through the BusinessView and WhereCondition code -- and did not understand some aspects of it.

    For the first constraint the Operator is nulled out --

    Code:
    if (!bracketOpen) {
                                sql+="      AND ( "+Const.CR;
                                bracketOpen=true;
                                justOpened=true;
                            }
     if (justOpened) conditions[i].setOperator(null); // give nothing but trouble!
    And for the subsequent constraints, Operators are added before the LHS for some reason,


    So - if i add two constraints --
    Code:
    		 mql.addConstraint("=", bview.findBusinessColumn("BC_CUSTOMERS_CUSTOMERNUMBER") , "1000");
    		 mql.addConstraint("=", bview.findBusinessColumn("BC_ORDERDETAILS_PRODUCTCODE") , "1000");
    The SQL query contains
    Code:
    WHERE 
              Customers.CUSTOMERNUMBER = Orders.CUSTOMERNUMBER
          AND Orders.ORDERNUMBER = Orderdetails.ORDERNUMBER
          AND ( 
                           Customers.CUSTOMERNUMBER 1000
                 =         Orderdetails.PRODUCTCODE 1000
              )
    Any reason for this?

    Do you feel it is better to implement my own MQLQuery class and only use the shortest path functions? or am i missing something?

    Cheers
    Murthy

  5. #5
    Join Date
    Nov 1999
    Posts
    9,729

    Default I already explained

    I already explained that this code is about to go away. Why should we waste more time on it? ;-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.