@Ignore(value="Cannot deterime if the format is narrowing") @Test public void testRewriteCrit_formatBigDecimal() throws Exception { String original = "formatBigDecimal(convert(pm1.g1.e4, bigdecimal), '#,##0.###') = '1,234.5'"; String expected = "pm1.g1.e4 = 1234.5"; QueryMetadataInterface metadata = RealMetadataFactory.example1Cached(); Criteria origCrit = parseCriteria(original, metadata); Criteria expectedCrit = parseCriteria(expected, metadata); Criteria actual = QueryRewriter.rewriteCriteria(origCrit, null, null); assertEquals("Did not rewrite correctly: ", expectedCrit, actual); }
public static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException{ return new QueryRewriter(metadata, context).rewriteCriteria(criteria); }
QueryRewriter { public static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException{ return new QueryRewriter(metadata, context).rewriteCriteria(criteria); } }
QueryRewriter { public static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException{ return new QueryRewriter(metadata, context).rewriteCriteria(criteria); } private  QueryRewriter(QueryMetadataInterface metadata,
            CommandContext context); }
QueryRewriter { public static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException{ return new QueryRewriter(metadata, context).rewriteCriteria(criteria); } private  QueryRewriter(QueryMetadataInterface metadata,
            CommandContext context); static Command evaluateAndRewrite(Command command, Evaluator eval, CommandContext context, QueryMetadataInterface metadata); static Criteria evaluateAndRewrite(Criteria criteria, Evaluator eval, CommandContext context, QueryMetadataInterface metadata); static Command rewrite(Command command, QueryMetadataInterface metadata, CommandContext context, Map<ElementSymbol, Expression> variableValues); static Command rewrite(Command command, QueryMetadataInterface metadata, CommandContext context); static boolean isDistinctWithGroupBy(Query query); QueryCommand rewriteOrderBy(QueryCommand queryCommand); static void rewriteOrderBy(QueryCommand queryCommand,
            final OrderBy orderBy, final List projectedSymbols, CommandContext context, QueryMetadataInterface metadata); static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata); static Criteria optimizeCriteria(CompoundCriteria criteria, QueryMetadataInterface metadata); static boolean isNull(Expression expr); static Expression rewriteExpression(Expression expression, CommandContext context, QueryMetadataInterface metadata); static Expression rewriteExpression(Expression expression, CommandContext context, QueryMetadataInterface metadata, boolean rewriteSubcommands); static Command rewriteAsUpsertProcedure(Insert insert, QueryMetadataInterface metadata, CommandContext context); static Query createInlineViewQuery(GroupSymbol inlineGroup,
                                               Command nested,
                                               QueryMetadataInterface metadata,
                                               List<? extends Expression> actualSymbols); static void makeSelectUnique(Select select, boolean expressionSymbolsOnly); static Command createDeleteProcedure(Delete delete, QueryMetadataInterface metadata, CommandContext context); static Command createUpdateProcedure(Update update, QueryMetadataInterface metadata, CommandContext context); }
QueryRewriter { public static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata) throws TeiidComponentException, TeiidProcessingException{ return new QueryRewriter(metadata, context).rewriteCriteria(criteria); } private  QueryRewriter(QueryMetadataInterface metadata,
            CommandContext context); static Command evaluateAndRewrite(Command command, Evaluator eval, CommandContext context, QueryMetadataInterface metadata); static Criteria evaluateAndRewrite(Criteria criteria, Evaluator eval, CommandContext context, QueryMetadataInterface metadata); static Command rewrite(Command command, QueryMetadataInterface metadata, CommandContext context, Map<ElementSymbol, Expression> variableValues); static Command rewrite(Command command, QueryMetadataInterface metadata, CommandContext context); static boolean isDistinctWithGroupBy(Query query); QueryCommand rewriteOrderBy(QueryCommand queryCommand); static void rewriteOrderBy(QueryCommand queryCommand,
            final OrderBy orderBy, final List projectedSymbols, CommandContext context, QueryMetadataInterface metadata); static Criteria rewriteCriteria(Criteria criteria, CommandContext context, QueryMetadataInterface metadata); static Criteria optimizeCriteria(CompoundCriteria criteria, QueryMetadataInterface metadata); static boolean isNull(Expression expr); static Expression rewriteExpression(Expression expression, CommandContext context, QueryMetadataInterface metadata); static Expression rewriteExpression(Expression expression, CommandContext context, QueryMetadataInterface metadata, boolean rewriteSubcommands); static Command rewriteAsUpsertProcedure(Insert insert, QueryMetadataInterface metadata, CommandContext context); static Query createInlineViewQuery(GroupSymbol inlineGroup,
                                               Command nested,
                                               QueryMetadataInterface metadata,
                                               List<? extends Expression> actualSymbols); static void makeSelectUnique(Select select, boolean expressionSymbolsOnly); static Command createDeleteProcedure(Delete delete, QueryMetadataInterface metadata, CommandContext context); static Command createUpdateProcedure(Update update, QueryMetadataInterface metadata, CommandContext context); static final CompareCriteria TRUE_CRITERIA; static final CompareCriteria FALSE_CRITERIA; static final CompareCriteria UNKNOWN_CRITERIA; }