-
1. Re: Date range criteria of Yahoo Translator
rareddy Apr 20, 2012 7:19 AM (in response to jeffreykwok)Jeffery,
You would need to extend the YahooExecutionFactory' class and provide "supportsBetweenCriteria" override method that returns true. Then you need to modify the "YahooExecution" class's execute method and handle "between" clause to handle and change it to appropriate Yahoo URL. Take look at 'TickerCollectorVisitor' class for example of how to traverse a query.
HTH
Ramesh..
-
2. Re: Date range criteria of Yahoo Translator
jeffreykwok Apr 20, 2012 7:35 AM (in response to rareddy)Thx Ramesh. "
@Override
public boolean supportsBetweenCriteria() {
return true;
}
is added before. However, the print out of the command in ExecutionFactory still remove the between condition..
>>>>>
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
throws TranslatorException {
System.out.println("command->" +command.toString());
return new YahooExecution((Select)command, metadata);
}
>>>>>>
If change the sql to " where dateprice='xxx' and symbol ='xxx'" -> then the select command can return the original input sql correctly
if the sql is "where dateprice >= '2012-02-02' and symbol ='xxx' -> the print out command is ' where symbol ='xxx' again.
Due to the incorrect command passed to the factory, i cannot get correct expression objects in TickerCollectorVisitor methods.
-
3. Re: Date range criteria of Yahoo Translator
rareddy Apr 20, 2012 8:33 AM (in response to jeffreykwok)1 of 1 people found this helpful>= is a different option. , see "supportsCompareCriteriaOrdered". For all the options see the JavaDoc on the ExecutionFactory class.
-
4. Re: Date range criteria of Yahoo Translator
shawkins Apr 20, 2012 10:39 AM (in response to rareddy)Between predicates are converted by the rewriter to => and <=, see the JavaDoc for supportsBetweenCriteria - it was only left for backwards capatiblity and should probably be removed for Teiid 8.
-
5. Re: Date range criteria of Yahoo Translator
rareddy Apr 20, 2012 11:00 AM (in response to shawkins) -
6. Re: Date range criteria of Yahoo Translator
jeffreykwok Apr 22, 2012 9:11 PM (in response to shawkins)Thx. After i add supportsCompareCriteriaOrdered and change the query to >= and <= criteria, it solved my problem