PDA

View Full Version : Query "Operator" does not seem to be included in the Generated SQL



cruel_world
01-04-2007, 01:14 PM
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' )

MattCasters
01-04-2007, 02:59 PM
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.

cruel_world
01-04-2007, 03:04 PM
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.

pvmurthy
01-14-2007, 11:33 AM
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 --



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 --

mql.addConstraint("=", bview.findBusinessColumn("BC_CUSTOMERS_CUSTOMERNUMBER") , "1000");
mql.addConstraint("=", bview.findBusinessColumn("BC_ORDERDETAILS_PRODUCTCODE") , "1000");



The SQL query contains


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

MattCasters
01-15-2007, 03:12 AM
I already explained that this code is about to go away. Why should we waste more time on it? ;-)